diff options
author | Arun Isaac | 2021-05-07 16:42:25 +0530 |
---|---|---|
committer | Arun Isaac | 2021-05-07 16:42:25 +0530 |
commit | 319dea49745c0f1b7c95fe8e3078794407c4c7c6 (patch) | |
tree | a8e0581402d7014fe6c1536dce0409be281fc800 /src/macros | |
parent | 932efe1a370e7a8c9f6c7a2dd0beddb36fb7a601 (diff) | |
download | nsmc-319dea49745c0f1b7c95fe8e3078794407c4c7c6.tar.gz nsmc-319dea49745c0f1b7c95fe8e3078794407c4c7c6.tar.lz nsmc-319dea49745c0f1b7c95fe8e3078794407c4c7c6.zip |
Define when and unless sc macros.
* src/macros/macros.sc (when, unless): New macros.
Diffstat (limited to 'src/macros')
-rw-r--r-- | src/macros/macros.sc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/macros/macros.sc b/src/macros/macros.sc index ac9e6d7..5ba9e1f 100644 --- a/src/macros/macros.sc +++ b/src/macros/macros.sc @@ -17,6 +17,15 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with nsmc. If not, see <https://www.gnu.org/licenses/>. +(sc-define-syntax (when condition body ...) + (cond + (condition + body ...))) + +(sc-define-syntax (unless condition body ...) + (when (not condition) + body ...)) + (sc-define-syntax (for-i index limit body ...) (for ((define index int 0) (< index limit) |