Usage of view-bind-many gives expansion error #79

Closed
soegaard opened this Issue Feb 12, 2012 · 5 comments

Comments

Projects
None yet
2 participants
Contributor

soegaard commented Feb 12, 2012

Hi,

The following expression

(view-bind-many (->view dom) 
                ["answer_input_1" "keyup" on-keyup/answer-input]
                ["answer_button" "click"  on-answer-button-click])

gives this error

expand: unbound identifier in module in: unsyntax

(The equivalent view-bind-many* expressions works fine.)

Owner

dyoo commented Feb 12, 2012

Thanks, will investigate.

Contributor

soegaard commented Feb 13, 2012

I suspect the first #' in the fold-expressions should be an #` .

;; A syntactic form to make it more convenient to focus and bind multiple things
;; (view-bind-many a-view
;; [id type function]
;; [id type function] ...)
(define-syntax (view-bind-many stx)
(syntax-case stx ()
[(_ a-view [a-selector a-type a-function] ...)
(foldl (lambda (a-selector a-type a-function a-view-stx)
#'(view-bind (view-focus #,a-view-stx #,a-selector)
#,a-type
#,a-function))
#'a-view
(syntax->list #'(a-selector ...))
(syntax->list #'(a-type ...))
(syntax->list #'(a-function ...)))]))

Owner

dyoo commented Feb 13, 2012

On Mon, Feb 13, 2012 at 10:48 AM, Jens Axel Søgaard
reply@reply.github.com
wrote:

I suspect the first #' in the fold-expressions should be an #` .

Agreed! Fixing this now. Let me add a test case for this as well.

Owner

dyoo commented Feb 13, 2012

On Mon, Feb 13, 2012 at 11:09 AM, Danny Yoo dyoo@cs.wpi.edu wrote:

On Mon, Feb 13, 2012 at 10:48 AM, Jens Axel Søgaard
reply@reply.github.com
wrote:

I suspect the first #' in the fold-expressions should be an #` .

Agreed!  Fixing this now.  Let me add a test case for this as well.

Fix in c8e0b84; I'll get a version of
Whalesong released later tonight that includes this.

Owner

dyoo commented Feb 15, 2012

Ok, added example in web-world/examples/color-buttons.rkt. This will be in the next release.

dyoo closed this Feb 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment