jathak / dart_scheme

Online Scheme interpreter, formerly for 61A
https://scheme.jenthakar.com
BSD 3-Clause "New" or "Revised" License
45 stars 5 forks source link

Adds a standalone Logic interpreter. #61

Closed jathak closed 6 years ago

jathak commented 6 years ago

Closes #58 and #60.

When the window's location includes "logic" somewhere in it, a standalone Logic interpreter is started instead of the normal Scheme interpreter.

To accomplish this, the global env and special forms of the Interpreter are cleared prior to loading the LogicLibrary.

A separate Intepreter instance is linked to buttons that can change the theme (this cannot be done through code from the standalone Logic interpreter.

As part of these changes, the (logic) built-in has been moved to the ExtraLibrary, and it now load the entire LogicLibrary when called within a normal Scheme interpreter. Since a new LogicLibrary is imported each time, it creates a new Logic environment for each call.