You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
psyntax.ss requires a handful of builtins which should be pretty easy to implement:
andmap, ormap (see my untested code below)
getprop, putprop, remprop
error
eval
void
Also we probably need a few more scraps of builtin syntax:
Implement letrec (can just cheat and reuse the implementation of letrec* probably)
(if #f #f) should return an unspecified value
And then hook it up:
Be able to create a non-global environment to run this in, so that all the details are not exposed to the world
Pass all code through sc-expand before compilation
psyntax.ss should expand to psyntax.pp, a natural test
;;; (andmap proc list1 list2 ...);;; returns true if proc returns true when applied to each element of list1;;; along with the corresponding elements of list2 ....
(defineandmap
(lambda (f first . rest)
(if (null? first)
#t
(if (apply f (car first) (mapcar rest))
(andmap f (cdr first) (mapcdr rest))
#f))))
;;; (ormap proc list1);;; returns the first non-false return result of proc applied to;;; the elements of list1 or false if none.
(defineormap
(lambda (f list1)
(if (null? list1)
#f
((lambda (result)
(if result
result
(ormap f (cdr list1))))
(apply f (car list1))))))
The text was updated successfully, but these errors were encountered:
https://www.cs.indiana.edu/chezscheme/syntax-case/
psyntax.ss
requires a handful of builtins which should be pretty easy to implement:andmap
,ormap
(see my untested code below)getprop
,putprop
,remprop
error
eval
void
Also we probably need a few more scraps of builtin syntax:
Implement
letrec
(can just cheat and reuse the implementation ofletrec*
probably)(if #f #f)
should return an unspecified valueAnd then hook it up:
Be able to create a non-global environment to run this in, so that all the details are not exposed to the world
Pass all code through
sc-expand
before compilationpsyntax.ss
should expand topsyntax.pp
, a natural testThe text was updated successfully, but these errors were encountered: