2016-03-16 22:18 GMT+01:00 Greg Trzeciak <gtrzec...@gmail.com>: > > Thanks Dan, seems to be exactly what I need (especially the combination > with ractive.js! BTW you couldn't find js framework with name more fitting > to work with racket ;) > I am only curious what racket subset does urlang include or rather what > won't work in urlang.
Hi Greg, Think of Urlang as JavaScript with s-expression syntax. The core urlang language includes constructs that mirror JavaScript almost one-to-one. So Urlang is not "Racket to JavaScript compiler". There are few miniscule differences: - functions support optional arguments - The = operator generates === in JavaScript - if will only count the false value as false (zero is not considered to be true) That said: Urlang does support macros, which means you can write constructs that expand into core Urlang. In urlang/for you will find a Racket-ish for constructs. That is for, for*, for/sum, for*/sum etc https://github.com/soegaard/urlang/blob/master/urlang/for.rkt In urlang/extra you will find some often used macros: These constructs can be used as expressions: ; (begin0 expr statement ...) ; (when test statement ... expr) ; (unless test statement ... expr) ; (cond [test statement ... expr] ...) ; (case val-expr clause ...) ; where clause is [(datum ...) statement ... expr] ; or [else statement ... expr] ; (letrec ([id val-expr] ...) statement ... expr) ; (let* ([id val-expr] ...) statement ... expr) ;; These constructs can be used as statements: ; (swhen test statement ...) ; (sunless test statement ...) ; (scond [test statement ...] ...) https://github.com/soegaard/urlang/blob/master/urlang/extra.rkt We are working on making some more examples. /Jens Axel -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.