alexnisnevich / ecmachine Goto Github PK
View Code? Open in Web Editor NEWLisp-based in-browser toy operating system
Home Page: http://alex.nisnevich.com/ecmachine/
Lisp-based in-browser toy operating system
Home Page: http://alex.nisnevich.com/ecmachine/
A string, by itself, displays as a string, but when part of a more "complex" display it is displayed as you'd expect a symbol would be displayed.
Eg:
ecmachine:/ guest$ "Foo"
"Foo"
ecmachine:/ guest$ (cons "Foo" "Bar")
(Foo . Bar)
ecmachine:/ guest$ (car (cons "Foo" "Bar" ))
"Foo"
Hi,
I just tried it in Firefox 11.0 and wasn't able to write anything in your command line.
Less of an issue, more of a suggestion.
Seeing the help text slowly grow, I'm wondering if it might be an idea to add emacs-a-like docstrings to the system. Not only would that keep the documentation with each function, it'd also allow the help command deliver help on specific functions and variables.
Mostly the reply displays a string return value as a string just fine. For example:
ecmachine:/ guest$ "Hello"
"Hello"
ecmachine:/ guest$ (car (cons "Hello" "World"))
"Hello"
ecmachine:/ guest$ ((lambda () "Hello"))
"Hello"
but when using + (which I notice has been extended to allow concatenation of strings) the result isn't shown as a string. If almost looks as if it's been turned into a symbol:
ecmachine:/ guest$ (+ "Hello")
Hello
ecmachine:/ guest$ (cons (+ "Hello") "World")
(Hello . "World")
ecmachine:/ guest$ (car (cons (+ "Hello") "World"))
Hello
Consider:
ecmachine:/ guest$ "
""
Is it planned to provide backquote and unquote support? For example:
> (define a 23)
> `(this is the number ,a)
(this is the number 23)
vs
ecmachine:/ guest$ (define a 23)
ecmachine:/ guest$ `(this is the number ,a)
[USER]: Eval Error: Unbound variable `(this is the number ,a)
I'm not sure if this is a deliberate design choice or not. I couldn't see anything obvious in the docs so I thought I'd mention it here just in case.
In Scheme you'd expect this:
> (cons 1 2)
(1 . 2)
> (cdr (cons 1 2))
2
But with ECMAchine it works a bit different:
ecmachine:/ guest$ (cons 1 2)
(1 2)
ecmachine:/ guest$ (cdr (cons 1 2))
(2)
You're using old version of jQuery Terminal that is using node that you run plugin on to scroll. The correct behavior (which is weird) is that you need to get scrollHeight
from body but scrollTop
set/get to html (or reversed), I use $('html,body')
but not in Safari that need body otherwise it will not work at all.
So you need to update jQuery Terminal in order to fix scrolling issue.
Now that strings have been added, what's the intended way of comparing them? I note that there's no 'string=?' and the like, there's no current support for eq?, eqv? or equal? and it seems that '=' (and the other obvious primitives) isn't being overridden for this:
ecmachine:/ guest$ (= "Foo" "Foo")
#f
It would be handy if 'display' could be added. Some method of simply displaying output would be rather useful and Scheme's 'display' would seem to be the way to go.
I seem to recall seeing (possibly in the source) that the idea was that ECMAchine would overload '+' so that it could be used for string concatenation. If that's the case, it looks like it might need a tweak:
ecmachine:/ guest$ (+ "Hello, " "World")
[USER]: undefined: Hello is not defined
I'll admit that my Scheme is a little rusty, so forgive me if I'm missing something.
I was looking for a way to get the whole argument list of a function in a single variable. The way I recall doing this in scheme is as follows:
(define (pointless-list . args) args)
The result of the above being something like:
> (pointless-list 1 2 3 4)
(1 2 3 4)
However, in ECMAchine:
ecmachine:/startup guest$ (define (pointless-list . args) args)
ecmachine:/startup guest$ (pointless-list 1 2 3 4)
[USER]: Apply Error: Incorrect number of parameters: expecting (. args) but received (1 2 3 4)
Am I missing something or is this an omission?
kill-all does not work as expected anymore:
ecmachine:/ guest$ (kill-all)
[USER]: undefined: args is not defined
ecmachine:/ guest$ (kill-all)
[USER]: undefined: args is not defined
ecmachine:/ guest$ kill-all
(λ () (map kill (filter (λ (x) (>= x 0)) (map car (processes)))))
each time kill-all
is called just one process is killed.
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.