Neil Jerram <[email protected]> writes:
> I wonder about possibly having some magic that would automatically
> match certain top-level forms and evaluate them at compile time. The
> case for this for 'define-reader-ctor' feels quite strong. For the
> load path case, it feels too hacky to try to recognize patterns like
> (set! %load-path (append %load-path ...))', but perhaps OK if we
> defined an 'add-to-load-path' procedure and applied the magic to that.
We already have an 'add-to-load-path' syntax. That way it doesn't need
any special magic since it can just expand to an `eval-when' usage but
apparently for some reason it doesn't do that at the moment (2.0.11):
scheme@(guile-user)> ,expand (add-to-load-path "foo")
(set! (@@ (guile) %load-path)
((@@ (guile) cons) "foo" (@@ (guile) %load-path)))
Taylan