Page 2 of 3

Re: Campus LIsP (32K)

Posted: Wed Dec 06, 2017 4:26 pm
by siggi
stefano wrote: Wed Dec 06, 2017 3:26 pm Editing a function is not possible, you need to re-enter it and crossing fingers you should be able to issue the garbage collector with (gc) to wipe the old one.
Hm, then it would be nice to have the souce code of the function somewhere in RAM (where it could be edited), and then could be imported to Lisp command line interpreter.
Do you know Olli's ZEDIT? It is an ASCII editor, running at 16K. It stores the ASCII text (!) at 32K (terminated by ^Z, up to 16KB) and has its HIRES-screen and stack above 48K (thus runs on 48K Zeddies). Maybe it could be used to enter/edit the lisp source code?
After it has terminated, the range 32-48K still contains the text (other memory then can be used e. g. by Lisp).
When it is RUN later again, it looks for existing text at 32-48K to edit it ...

http://forum.tlienhard.com/phpBB3/viewt ... ilit=zedit

Siggi

Re: Campus LIsP (32K)

Posted: Wed Dec 06, 2017 9:17 pm
by stefano
There is a Japanese port of the Campus Lisp on the Sharp PC-G 850 which works exactly in this way.
http://ver0.sakura.ne.jp/g800/clisp2.png

It is surely a possible approach, I was focused on the portability, this same program can become, in example, very similar to Spec Lisp and run on most of the z88dk supported targets (often also with graphics).
A 32k variant in hrg able to emulate the Spec Lisp is surely feasible, or, in classic text mode much more of the 48k ram area is usable compared to a Spectrum (more than enough for an editor).

Re: Campus LIsP (32K)

Posted: Thu Dec 07, 2017 8:37 am
by siggi
Hi Stefano
to keep it portable: could you just add an additional option (or a command) to read input from an ASCII string somewehre in memory (e. g. from 8192 of a 56K Zeddy)?

Then I could write a small program to
- copy a text (created by ZEDIT) from 32K to 8K and replace ^Z by a \0 (to create a well-terminated C string)
or
- read (peek) the source code out of REM lines of a BASIC-program (to use the BASIC editor to create the Lisp program) and convert the text into ASCII and write it as C-string to 8K
which is RUN before your Clisp is started.

That would then be also usable at other systems (if they have free ram, maybe at other locations).

Regards
Siggi

Re: Campus LIsP (32K)

Posted: Fri Dec 08, 2017 2:48 pm
by stefano
I understand your idea, I'll try to set up a test environment (e.g. a snapshot with a pre- loaded) lisp sentence at a given position (8192 ?).
z88dk could help in a more efficient way, since it supports file redirection, but a sequential or random file access will be necessary (not considering the memory related concerns due to the extra space for the file driver and its buffers) ... so I will experiment a bit.
My past Lisp submission included a memory snapshot with a pre-loaded set of function definitions (and the initialization code removed) to squeeze as much functionality as possible, I'm telling it to explain that to deal with extra memory is a delicate task .. so please be precise about the memory block you think to be appropriate :)

Re: Campus LIsP (32K)

Posted: Fri Dec 08, 2017 2:57 pm
by mrtinb
I think Siggi is thinking of a simpler solution.

The user has to load the file @8k or @32k prior to loading CLIsP (with ZxPand, ZxBlast, SIMDOS2 or similar storage solution).

CLIsP simply needs a function that interpreat a zero terminated LISP from a memory location.

E.g.
(READ-SRC 8192)
(READ-SRC 32768)

Re: Campus LIsP (32K)

Posted: Fri Dec 08, 2017 3:39 pm
by siggi
Yes, nowadays there are a lot of solutions, to fast-load a program or data anywhere into ram (Zxpand, USB-drivers, Mefisdos, ZeddyNet).
Thus the workflow I had in mind would be:
- Load and run ZEDIT and create a Lisp source code(results in ASCII text at 32K). If necessary, save the text (Lisp source code) for later use or correction
- Load and start a tool (M/C or Basic program) to convert the text into a valid C-string (terminated by \0) and copy it to a free location in ram (e. g. at 8192)
- Load and start your Lisp (as is: interpreter at 16K, using ram above 32K)
- enter a new command to your Lisp to read input from the C-string in memory (as Martin wrote: READ-SRC 8192)
- run the Lisp program

If the program does not work as expected: load ZEDIT and the saved text again and correct it and restart the workflow as written above.

Thus the changes in your Lisp should be: instead of interpreting the command entered by keyboard, interpret the commands (Lisp source) within the string at given location. Then return to command mode and wait for the next comand from keyboard.

Thus instead of

Code: Select all

gets(command);
interpret(command);

Code: Select all

interpret (c_string_in_memory);
Regards
Siggi

Re: Campus LIsP (32K)

Posted: Sun Dec 10, 2017 4:31 pm
by dh1pba
How to save a program and load programs with ZXPand (Eighty One)?
Thank you.
Greeting

Re: Campus LIsP (32K)

Posted: Sun Dec 10, 2017 4:57 pm
by mrtinb
Enable ZXpand in the hardware menu.

LOAD"name" and SAVE"name" uses ZXpand. LOAD "" uses tape.

Re: Campus LIsP (32K)

Posted: Sun Dec 10, 2017 5:32 pm
by sirmorris
As Martin said. There are further facilities for loading and saving blocks of data in memory. The manual is here.

Re: Campus LIsP (32K)

Posted: Mon Dec 11, 2017 8:58 am
by dh1pba
Good morning.

Nix Load HANOI.I with ZXPand .


Greeting