picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit 85dfbccb54bf576e6dd715ad29ca213954578e57
parent d58cfd7af3fefc3eca391db34bde859af7cb8349
Author: Alexander Burger <abu@software-lab.de>
Date:   Tue,  8 Mar 2011 07:27:12 +0100

'version' also for 32-bit
Diffstat:
MCHANGES | 1+
Mdoc/refV.html | 7++++---
Mersatz/fun.src | 6+++---
Mersatz/picolisp.jar | 0
Msrc/Makefile | 3++-
Msrc/main.c | 25++++++++++++++++++++++++-
Asrc/mkVers | 15+++++++++++++++
Msrc/pico.h | 3++-
Msrc/tab.c | 3++-
Asrc/vers.h | 1+
Msrc64/version.l | 4++--
11 files changed, 56 insertions(+), 12 deletions(-)

diff --git a/CHANGES b/CHANGES @@ -1,4 +1,5 @@ * XXmar11 picoLisp-3.0.6 + 'version' also for 32-bit Map/apply support for FEXPRs Bug in vararg method calls (64-bit) 'fill' handles '^' diff --git a/doc/refV.html b/doc/refV.html @@ -86,9 +86,10 @@ href="ref_.html#::">::</a></code>. </code></pre> <dt><a name="version"><code>(version ['flg]) -> lst</code></a> -<dd>(64-bit version only) Prints the current version as a string of -dot-separated numbers, and returns the current version as a list of numbers. -When <code>flg</code> is non-NIL, printing is suppressed. +<dd>Prints the current version as a string of dot-separated numbers, and returns +the current version as a list of numbers. The JVM- and C-versions print an +additional "JVM" or "C", respectively, separated by a space. When +<code>flg</code> is non-NIL, printing is suppressed. <pre><code> $ ./p -version diff --git a/ersatz/fun.src b/ersatz/fun.src @@ -1,4 +1,4 @@ -# 25feb11abu +# 07mar11abu # (c) Software Lab. Alexander Burger # Ersatz PicoLisp Functions @@ -410,8 +410,8 @@ opt (str) version (i x) if (ex.Cdr.Car.eval() == Nil) { for (i = 0; i < 4; ++i) - OutFile.Wr.print(Version[i] + (i == 3? "-" : ".")); - OutFile.Wr.println('J'); + OutFile.Wr.print(Version[i] + (i == 3? " " : ".")); + OutFile.Wr.println("JVM"); OutFile.Wr.flush(); } for (x = Nil, i = 4; --i >= 0;) diff --git a/ersatz/picolisp.jar b/ersatz/picolisp.jar Binary files differ. diff --git a/src/Makefile b/src/Makefile @@ -1,4 +1,4 @@ -# 04oct10abu +# 07mar11abu # 27feb08rdo # (c) Software Lab. Alexander Burger @@ -77,6 +77,7 @@ all: picolisp tools gate x11 $(picoFiles:.c=.o) ext.o ht.o z3d.o: pico.h +main.o: vers.h ifeq ($(OS), Cygwin) diff --git a/src/main.c b/src/main.c @@ -1,8 +1,9 @@ -/* 01mar11abu +/* 07mar11abu * (c) Software Lab. Alexander Burger */ #include "pico.h" +#include "vers.h" #ifdef __CYGWIN__ #define O_ASYNC FASYNC @@ -1162,6 +1163,28 @@ any doOpt(any ex __attribute__((unused))) { return *AV && strcmp(*AV,"-")? mkStr(*AV++) : Nil; } +// (version ['flg]) -> lst +any doVersion(any x) { + int i; + cell c1; + + x = cdr(x); + if (isNil(EVAL(car(x)))) { + for (i = 0; i < 4; ++i) { + outWord((word)Version[i]); + Env.put(i == 3? ' ' : '.'); + } + Env.put('C'); + newline(); + } + Push(c1, Nil); + i = 4; + do + data(c1) = cons(box(Version[--i] * 2), data(c1)); + while (i); + return Pop(c1); +} + any loadAll(any ex) { any x = Nil; diff --git a/src/mkVers b/src/mkVers @@ -0,0 +1,15 @@ +#!../bin/picolisp ../lib.l +# 07mar11abu +# (c) Software Lab. Alexander Burger + +(load "../src64/version.l") + +(out "vers.h" + (prinl + "static byte Version[4] = {" + (glue "," *Version) + "};" ) ) + +(bye) + +# vi:et:ts=3:sw=3 diff --git a/src/pico.h b/src/pico.h @@ -1,4 +1,4 @@ -/* 23jan11abu +/* 07mar11abu * (c) Software Lab. Alexander Burger */ @@ -729,6 +729,7 @@ any doUppc(any); any doUse(any); any doUsec(any); any doVal(any); +any doVersion(any); any doWait(any); any doWhen(any); any doWhile(any); diff --git a/src/tab.c b/src/tab.c @@ -1,4 +1,4 @@ -/* 23jan11abu +/* 07mar11abu * (c) Software Lab. Alexander Burger */ @@ -341,6 +341,7 @@ static symInit Symbols[] = { {doUse, "use"}, {doUsec, "usec"}, {doVal, "val"}, + {doVersion, "version"}, {doWait, "wait"}, {doWhen, "when"}, {doWhile, "while"}, diff --git a/src/vers.h b/src/vers.h @@ -0,0 +1 @@ +static byte Version[4] = {3,0,5,21}; diff --git a/src64/version.l b/src64/version.l @@ -1,6 +1,6 @@ -# 04mar11abu +# 07mar11abu # (c) Software Lab. Alexander Burger -(de *Version 3 0 5 20) +(de *Version 3 0 5 21) # vi:et:ts=3:sw=3