(let ([var1 value1] [var2 value2]) expr)
** Note: **
In:
(let ([var1 value1] [var2 value2]) expr)
I cannot use the value of var1 to calculate value2.
let* allows to do that so for example the following is allowed:
(let* ([x 1] [y (+ x 1)]) (list y x))
letrec allows to use a var to calculate the value of a value recursively. So the following is allowed:
(let* ([x 1] [y (+ x 1)]) (list y x))
(define (first x . l) l) (define (rest x . l) l)
(first 1 2 3 4) ;; 1 (rest 1 2 3 4) ;; (2, 3, 4)
(cond [(cond1) result1] ... [(condn) resultn] [else elseresult])
(match-case x ((unless ?test . ?rest) `(if (not ,test) ,@rest)) (else x))
- ?arg assigns a value to arg
(string->list str) (list->string lst) ....
(define-macro (macro-name params)
after ` everything is interpreted normally but: ,varname // splices the variable ,@params // splices a list into the elements
(symbol->keyword id)
(case m ((car) a) ((cdr) d) ((set-car!) (set! a v)) ((set-cdr!) (set! d v)))))
(format "tal/~a" "cual") // = tal/cual
Are literals quoted with #, eg:
#\A
( :css "../styles.css") ()
( :onmouseover ~(innerHTML-set! this "h"))
- To access a server variable use $:
( :onmouseover ~(innerHTML-set! this $m))
- Call a service