[z88dk-dev] LISP language

Bridge to the z88dk-developers mailing list
Post Reply
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

[z88dk-dev] LISP language

Post by stefano »

I discovered this gem by Hirotsugu Kakugawa:

http://www-masu.ist.osaka-u.ac.jp/~kaku ... cks/clisp/

It is a smart minimalistic lisp implementation. I played a bit with it to make it more generic and to add somethinf and now it is ready to build with z88dk.
My improvements include a SCHEME emulation mode (the program needs to be recompiled for it.

The program is in examples/clisp.

Alvin used it as an example to build a ZX Spectrum ROM.



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

I improved the Campus LIsP a bit.
The 'while' directive idea comes from the EMACS Lisp and permits simplified non-recursive mapcar/reduce functions..
so:

]
(eliza)
(i want to crush you)

((do you really) (want to crush me))?
(yes)

((how can you be so sure) (you want to crush me))?



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it ... p-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

]
(eliza)
(i want to crush you)

((do you really) (want to crush me))?
(yes)

((how can you be so sure) (you want to crush me))?
Nice I will have to look at it again. I haven't programmed in Lisp (well Scheme actually) since school so it's all a little foggy.



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it ... p-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

>Nice I will have to look at it again. I haven't programmed in Lisp (well Scheme actually) since school so it's all a little foggy.

Scheme is slightly different, expecially for the fact it keeps functions and variables together, but I added a syntax variant for those used to write programs in SCHEME (it is still experimental and does not move all the objects in a single list, though).

Curiously it fits very well in a 32K expanded ZX81: the machine limits and the Language limits match perfectly: we have the double-quote symble available to replace the missing "quote" and the higher space cannot store machine code programs but can keep the machine stack and all the LISP stuff:

http://www.sinclairzxworld.com/viewtopi ... 7b950eb877



------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

I wrote up a page about compiling the current version with the new clib:

http://www.z88dk.org/wiki/doku.php?id=l ... ples:clisp

I modified the source to produce the large version only.

sdcc was kind enough to point out that the variables d1, d2, and i declared in l_equal are not used:

long
l_equal(long s1, long s2)
{
int d1 = s1 & D_MASK_DATA;
int d2 = s2 & D_MASK_DATA;
int i;

if (D_GET_TAG(s1) != D_GET_TAG(s2))
return TAG_NIL;
switch (D_GET_TAG(s1)){
case TAG_CONS:
if (l_equal(l_car(s1), l_car(s1)) == TAG_NIL)
return TAG_NIL;
return l_equal(l_car(s2), l_car(s2));
default:
return (s1 == s2) ? TAG_T : TAG_NIL;
}
}



------------------------------------------------------------------------------
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

I forgot to attach a link to the zip with executables:

https://drive.google.com/file/d/0B6XhJJ ... sp=sharing



------------------------------------------------------------------------------
Post Reply