On 02/12/2012 12:30 PM, FS Racket wrote:
I'm trying to write a macro that where the pre-transformation form is:
(==> exp1 exp2 ... expn)
and where exp2 through expression expn are sexps that contain a '_'
placeholder. The idea is that starting with exp2, the _ gets replaced
with the previous e
On Feb 12, 2012, at 2:53 PM, FS Racket wrote:
> In the example that doesn't work, the first mult is needed for another use of
> ==>. In the simpler examples, it is not. Notice that the orphaned mult occurs
> on the second step when another use is expanded, while in the simpler
> examples anoth
>
> In the example that doesn't work, the first mult is needed for another use
> of ==>. In the simpler examples, it is not. Notice that the orphaned mult
> occurs on the second step when another use is expanded, while in the
> simpler examples another use of ==> does not occur. In the simple case
On Feb 12, 2012, at 1:09 PM, FS Racket wrote:
>
>
> On Sun, Feb 12, 2012 at 1:34 PM, Richard Cleis wrote:
> The DrRacket interactions window replies with 48, not an error, when your
> syntax is defined in the definitions window, your function is defined in the
> interactions area, and the exa
Have you considered using this kind of macro:
#lang racket
(define-syntax ==>
(syntax-rules ()
[(_ (it) one) one]
[(_ (it) one two ...) (let ((it one)) (==> (it) two ...))]))
(==> (it) (+ 1 1) (+ it 1) (+ it it))
(define mult *)
(==> (it) (* 1 1) (* it 1) (* it it))
On Feb 12,
On Sun, Feb 12, 2012 at 1:34 PM, Richard Cleis wrote:
> The DrRacket interactions window replies with 48, not an error, when your
> syntax is defined in the definitions window, your function is defined in
> the interactions area, and the example is finally run in the interactions
> area.
>
> How
The DrRacket interactions window replies with 48, not an error, when your
syntax is defined in the definitions window, your function is defined in the
interactions area, and the example is finally run in the interactions area.
How are you making it fail?
Also, have you attempted to use the Mac
I'm trying to write a macro that where the pre-transformation form is:
(==> exp1 exp2 ... expn)
and where exp2 through expression expn are sexps that contain a '_'
placeholder. The idea is that starting with exp2, the _ gets replaced with
the previous expression. For example:
(==> 12 (+ _ 2) (
8 matches
Mail list logo