Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

LispCraft

Name: Anonymous 2011-04-09 5:21

Hi, all. I finally completed Warcraft 2 implementation in LISP.
http://img859.imageshack.us/i/52320836.png/

Took me a few months, though, but mostly because I was too lazy and my DSL is still pretty buggy, has poor debugging support and long compilation times (takes about 30 seconds to reload source file). Anyway, this proves, that writing a game in Lisp is relatively easy, even for a single person.

Name: Anonymous 2013-03-18 20:58

>>79
For instance, the context of the character < in #include <frozenvoid.h> is different to the one in if (a < b). The compiler knows that < means different things in different places. Limiting yourself to a one-to-one mapping between symbols and functions is silly.

Name: Anonymous 2013-03-18 21:24

I love Vintage Nikita too.

Name: Anonymous 2013-03-18 22:46

>>79
Is that syntax based on Template Haskell?

Name: Anonymous 2013-03-18 23:25

>>81
Compiler doesn't even see #include <frozenvoid.h>, do you know?

Name: Anonymous 2013-03-18 23:27

Also,
list<pair<string,int>>

Name: Anonymous 2013-03-19 6:15

>>84
It's an example, use your brain instead of picking out the irrelevant details so you don't have to respond properly.
Wait, does Symta even have lexical scoping? It wouldn't surprise me if it didn't. Have any scoping whatsoever, I mean. You do seem that clueless.

Name: Anonymous 2013-03-19 8:26

>>81
No. Reader reads <...> as simple ("<>" (...)) and if `>` is missing, it would be a read-time error. Of course macro can treat this ("<>" (...))

>>86
Symta does have lexical scoping, but I also use it to implement OOP. X and Y in (X:1 | Y:2 | X+Y) or (X:1 | Y:2 | sum = X+Y) wont be seen outside of (...), but in case of `sum = X+Y`, (...) gives closure with method `sum`. This provides encapsulation. Packages are implemented the same way, just to make reasoning about them easier (I was confused by Common Lisp's eval-when mess).

Name: Anonymous 2013-03-19 8:28

>>87
I.e. Symta is a context free language, which should make parsing easier.

Name: Anonymous 2013-03-19 8:52

>>87
Oh, pardon me. I thought >>84 was you.
In any case, can't it treat an unmatched < as `lt` instead of an error?

Name: Anonymous 2013-03-19 9:04

>>89
No. How would you parse <A < B = C>: <(A < B) = C> or <A (<B = C>)?

Name: Anonymous 2013-03-19 9:27

>>90
<A in <A (<B = C>) has no left-hand side.
Even D < A < B = C > would work because after D it should expect an operator, not another operand.
There are also various precedence rules you could apply.

Name: Anonymous 2013-03-19 9:28

>>91
*wouldn't

Name: Anonymous 2013-03-19 9:54

>>91
<A in <A (<B = C>) has no left-hand side.
Usually <...> is part of some larger expression, like [X <A < B = C> Y]

Even D < A < B = C > would work because after D it should expect an operator, not another operand.
How about (list D < A < B = C >)? Why not (list (D < A) (< B = C >))?

Name: Anonymous 2013-03-19 9:55

>>91
What about (list < A < B = C >)? It will be parsed as ((list < A) ..)

Name: Anonymous 2013-03-19 11:26

>>90-94
Cool edge cases

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List