Something like:
let query = [yql| SELECT name FROM github.user.info WHERE id = $s(name); |]
name = "dag"
in [jmacro| YUI().use "yql" \y ->
y.YQL `(query)` \r ->
alert r.query.results.user.name |]
However preferably more type safe: the above query can be used as a string anywhere in JS. One option is to save the callback in a variable:
[jmacro| YUI().use "yql" \y
{ var cb = \r -> alert r.query.results.user.name
; `(query y cb)`
} |]
However, having to name the function is arguably ugly.
Something like:
However preferably more type safe: the above query can be used as a string anywhere in JS. One option is to save the callback in a variable:
[jmacro| YUI().use "yql" \y { var cb = \r -> alert r.query.results.user.name ; `(query y cb)` } |]However, having to name the function is arguably ugly.