The standard primitive Scheme function scheme-report-environment is an immutable source of (usually) mutable namespaces. I think that the optional extension to chicken Scheme largely brings that platform up to the full numerical facilities defined by R5RS. The names provided in namespaces from scheme-report-environment still provides the limited arithmetic functions from the pre-extended Scheme platform. If this is so then
(expt 2 100) ⇒ 1267650600228229401496703205376should work for the extended platform but
(eval '(expt 2 100) (scheme-report-environment 5))should fail. Below is a plan to provide an upgraded scheme-report-environment that is based on the functions available on the extended platform.
This Scheme code is designed to provide a new source of namespaces for Chicken Scheme in particular. I think that the optional feature which equips that system with a more complete set of arithmetic functions which are defined but not required by R5RS. The namespace source defined in R5RS is conventionally called scheme-report-environment and the current extended package provides a namespace source which includes names of only the unextended primitives.
There is another issue: Some of the extensions, such as the bitwise-and are not described in R5RS but are nonetheless described in RFIs and common among Schemes. It will be common to want a namespace which includes these too. Several Scheme platforms have assumed that scheme-report-environment is to be limited to those names in R5RS and thus to exclude RFI names. I will try for a namespace source that includes both and remain neutral on what to name the new source.
I list here some presumptions that I make in the form of simple Scheme expressions that should evaluate as shown:
(eval '(cons 4 6)) ⇒ (4 . 6)This exploits the widespread but deprecated R4RS one argument eval. The expression (map eval opl) invokes the one argument eval. Most text in the large definition of opl would otherwise need to be duplicated.
(let ((ns (scheme-report-environment 5))) (eval '(set! car 42) ns) (eval 'car ns)) ⇒ 42This verifies that fresh name spaces are mutable, which is encouraged but not required by R5RS.
The symbol list opl is of symbols defined in R5RS and which have been improved. Such symbols become bound to the improved functions in the namespaces from the new namespace source newEnvSrc. The symbol list nopl is of symbols not defined in R5RS or at least not in the fresh namespaces from the extant source but desired in new source.