Double Evaluation in $ macro
Bug #518147 reported by
Stardom
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ken Dickey |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Currently, the macro is defined as
;; [$ <selector-sym> <obj> <arg> ...]
(define-syntax $ ;; send [user syntax]
(syntax-rules ()
[($ <selector> <obj> <arg> ...)
;;=>
((-> '<selector> <obj>) <obj> <arg> ...)
]
) )
<obj> is repeated twice which causes double evaluation.
Changed in kend: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I have never seen a case in practice where a general expression is used for <obj> rather than an object reference (a variable naming an object).
It is certainly a trivial change to add the let, e.g.
(define-syntax $ ;; send [user syntax]
(syntax-rules ()
[($ <selector> <obj> <arg> ...)
;;=>
(let [(obj <obj>)]
((-> '<selector> obj) obj <arg> ...))
]
) )
I would be interested to know the context of the problem.
Thks,
-KenD