This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Ticket 277: Add another argument to load to be the evaluator

2012-02-26 17:18:31
WG1 - Core
alexshinn
major
cowan
invalid
source
closed
2011-09-08 22:01:05
defect

By allowing an evaluation function to be passed to load, it becomes possible to use it for languages other than Scheme expressed in S-expression syntax. The function would receive an S-expression read from the file and the environment passed to load.

summaryAdd another argument to eval and load to be the evaluatorAdd another argument to load to be the evaluator
description`eval` currently takes an environment, and we are voting on whether to allow `load` to take one. By allowing an evaluation function to be passed as well, it becomes possible to use the eval/load infrastructure for languages other than Scheme expressed in S-expression syntax. This is a Good Thing.By allowing an evaluation function to be passed to `load`, it becomes possible to use it for languages other than Scheme expressed in S-expression syntax. The function would receive an S-expression read from the file and the environment passed to `load`.

Possibilities:

env-only: status quo, default environment is (interaction-environment)

eval-only: eliminate the environment argument in favor of a evaluator argument, a one-argument procedure (by default, (lambda (x) (eval x (interaction-environment))

env-first: environment argument followed by evaluator argument, same defaults

eval-first: evaluator argument followed by environment argument, same defaults

resolutioninvalid
statusnewclosed

This seems too random. There is no clear motivation or examples, the status quo is widely implemented and sufficient for alternate languages by specifying the env, and yet both solutions are insufficient for languages with a different read syntax.

It's too late in the process to consider a change like this without any precedent.