Live data from Hacker News

Lisp interpreter made with Action Script 3.

solve-et-coagula.com

1–10 of 11 posts

Re: Lisp interpreter made with Action Script 3.

#3
It doesn't seem to support closures.

    User>(defun accgen (x)
            (lambda (y)
               (incf x y)))

    ACCGEN
    User>(setf foo (accgen 5))

    
    User>(funcall foo 5)

    NaN
    User>(let ((bar "bar"))
            (defun qux ()
               (print bar)))

    QUX
    User>(qux)

    null
    User>

Re: Lisp interpreter made with Action Script 3.

#6
post #5
post #4

He has released the source code of the interpreter: http://www.solve-et-coagula.com/?p=9 .

That's the first time I've looked at ActionScript code. Javascript has such an elegant object system - they should have kept it.

Could be wrong but I think you can still use the prototype syntax if you want.

Re: Lisp interpreter made with Action Script 3.

#7
post #5

Earlier quoted context omitted.

That's the first time I've looked at ActionScript code. Javascript has such an elegant object system - they should have kept it.

Could be wrong but I think you can still use the prototype syntax if you want.

I know that the prototype syntax is available in as2, but I think it was removed in as3. I agree that the prototype syntax is more elegant, but I really believe Adobe was trying to appeal to Java and .NET developers.

Re: Lisp interpreter made with Action Script 3.

#8
post #7

Earlier quoted context omitted.

Could be wrong but I think you can still use the prototype syntax if you want.

I know that the prototype syntax is available in as2, but I think it was removed in as3. I agree that the prototype syntax is more elegant, but I really believe Adobe was trying to appeal to Java and .NET developers.

"but I think it was removed in as3"

Wrong. I was curious so i tested it (i've been experimenting with Flex 2). The following code outputs "blah blah":

var foo:Function = function() {}

foo.prototype.someMethod = function() { trace("blah blah"); }

new foo().someMethod();

I think the prototype syntax was kept to maintain backwards compatibility.

Re: Lisp interpreter made with Action Script 3.

#9
post #7

Earlier quoted context omitted.

I know that the prototype syntax is available in as2, but I think it was removed in as3. I agree that the prototype syntax is more elegant, but I really believe Adobe was trying to appeal to Java and .NET developers.

"but I think it was removed in as3" Wrong. I was curious so i tested it (i've been experimenting with Flex 2). The following code outputs "blah blah": var foo:Function = function() {} foo.prototype.someMethod = function() { trace("blah blah"); } new foo().someMethod(); I think the prototype syntax was kept to maintain backwards compatibility.

Thats cool, does it work with creating classes that way as well?

Re: Lisp interpreter made with Action Script 3.

#10
post #7

Earlier quoted context omitted.

Could be wrong but I think you can still use the prototype syntax if you want.

I know that the prototype syntax is available in as2, but I think it was removed in as3. I agree that the prototype syntax is more elegant, but I really believe Adobe was trying to appeal to Java and .NET developers.

[deleted]
Post reply on HN