loris1123 / rbscheme Goto Github PK
View Code? Open in Web Editor NEWScheme Interpreter written in Ruby
License: Other
Scheme Interpreter written in Ruby
License: Other
Try to show where the syntax mistake was.
Something like:
==============================================
Scheme Error
----------------------------------------------
Invalid Syntax: 2.3.
^
==============================================
Symboltable still uses rubys list
When calling cdr-function you get a bracket around the cdr.
(cdr (cons 1 2))
=> 2)
When writing scheme code it would be cool to do something like this:
(define (plusone x)
(+ x 1)
)
At the moment only single-line is allowed:
(define (plusone x) (+ x 1))
(define a (cons 1 2))
=> Unimplemented print: SchemeSymbol . (1 . 2)
If you input (cons 1 2) (cons 2 3)
only the first cons will be evaluated
(abs "foobar")
=> Undefined Variable
calling -4
results in a Unknown Variable.
Workaround:
(define -4 (- 4 8)) # Thats awesome...
Objects like true, false, nil, void should exist only one time.
At the moment, every time I enter #t a new SchemeTrue object is generated.
Is it actually working?
Create a history for interactive mode to nagivate with ArrowUp/Down to previous inputs
The result when evaluation a statement in GUI will be printed to the console, instead of the GUI.
This is a result of the new printer
Tail Call Optimization should be enabled for RbScheme.
To enable TCO in Ruby use this:
RubyVM::InstructionSequence.compile_option = {
tailcall_optimization: true,
trace_instruction: false
}
I have to debug if this will enable TCO in my Scheme-Recursions. For this I first have to do #10
Add floatnumbers and their aritmetics
(define (fac n)(if (eq? n 1) 1 (* n (fac (- n 1)))))
This is a working faculty function using recursion. When I enter this I get the error Invalid number of arguments for SchemeDefine. Need between 2 and 2. Got 5
, which is obviously wrong.
+-*/ allow only 2 arguments
(+ 2 2)
Original scheme allows an undefine number of arguments.
(+ 1 2 3 4 5)
Current workaround:
(+ 1 (+ 2 (+ 3 (+ 4 5))))
Defining a function or variable will result in a print.
But when doing a define, scheme should not print. It should be only printed when the function/variable is actually called
Not working:
(define (aFunc x y)
(define (bFunc a b)
(+ a b))
(bFunc x y))
define
allows only 1 argument as a function body. Should allow * expressions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.