[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
macro definition for continue and break
From: |
Damien Mattei |
Subject: |
macro definition for continue and break |
Date: |
Sun, 4 Sep 2022 10:19:14 +0200 |
my previous question ,clearly more, is :
(define-syntax for/bc
(syntax-rules (continue break)
((_ (init test incrmt) b1 ...)
(call/cc (lambda (break)
(let ()
init
(let loop ()
(when test
(call/cc (lambda (continue) b1 ...))
incrmt
(loop)))))))))
is there a way to make working this macro in a R6RS compatible way (i know
it is possible in Racket or with syntax features...)
to avoid error:
(for/bc ({i <+ 0} {i < 5} {i <- {i + 1}})
{x <+ 7}
(display x)
(newline)
(break))
;;; <stdin>:2:73: warning: possibly wrong number of arguments to `break'
7
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Wrong number of arguments to #<procedure break (pred clist)>
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
Damien
- macro definition for continue and break,
Damien Mattei <=
- Re: macro definition for continue and break, Jean Abou Samra, 2022/09/04
- Message not available
- Re: macro definition for continue and break, Jean Abou Samra, 2022/09/04
- Re: macro definition for continue and break, Linus Björnstam, 2022/09/12
- Loop macros (was: Re: macro definition for continue and break), Maxime Devos, 2022/09/12
- Re: Loop macros (was: Re: macro definition for continue and break), Linus Björnstam, 2022/09/12
- Re: Loop macros (was: Re: macro definition for continue and break), Damien Mattei, 2022/09/13
- Re: Loop macros (was: Re: macro definition for continue and break), Maxime Devos, 2022/09/13
- Re: Loop macros (was: Re: macro definition for continue and break), Damien Mattei, 2022/09/14
- Re: macro definition for continue and break, Damien Mattei, 2022/09/13