Mew is a library targetting R5RS/R7RS scheme, which provides some
conveniences inspired from Goo, Clojure and Arc to allow writing more
compact code.
== Re-Exports
Mew re-exports SRFI-69 (Basic hash tables),
SRFI-158 (Generators and Accumulators),
and {{matchable}}.
== Definitions, bindings and assignments
(def )
(def ( ) )
Alias for {{define}}.
(fun )
Alias for {{lambda}}.
(loc ( ... ) )
Binds local variables in pattern (ala the {{match}} macro)
{{pat1}} to the result of evaluating {{val1}},
then {{pat2}} to {{val2}}, etc., then evaluates {{body}}.
Assignments can refer to previously assigned values of the {{loc}}.
(rec )
(rec ( ) )
See Module%20(chicken%20base)#rec or SRFI-31.
Often, using {{def}} in an inner scope is preferable to using {{rec}}.
(set )
Alias for {{set!}}.
== Control flow
(esc )
Bind {{}} to the current continuation, then run {{}}.
Code should not pass {{}} outside the lexical scope
and only call it once---use {{call/cc}} else.
(fin . )
Evaluate {{}}, then evaluate {{}}, even if {{}}
used a non-local exit (as from {{esc}}).
Returns value of {{}}, so can also be used as a replacment
for Common Lisp PROG1.
(rep (( ) ...) )
Explicit form of named let.
(seq . )
Alias for {{begin}}.
(unless ...)
(when ...)
As in R7RS-small.
(while ...)
(until ...)
Evaluate {{}} while {{}} is true/false.
== Numeric helpers
(inc )
(dec )
Increment or decrement the argument by 1.
(div . )
Alias for {{floor-quotient}}.
(mod . )
Alias for {{floor-remainder}}.
== General helpers
(app . )
Alias for {{apply}}.
(op
Returns a procedure that evaluates {{