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 596346e689c540528cf3de721ab90b0f64f67a86
parent 85552eef205d9a97300f3d63e84719c1713ff9d9
Author: Commit-Bot <unknown>
Date:   Fri, 19 Nov 2010 18:27:45 +0000

Automatic commit from picoLisp.tgz, From: Fri, 19 Nov 2010 18:27:45 GMT
Diffstat:
Mersatz/fun.src | 84++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mersatz/lib.l | 23++++++++++++++++++++++-
Mersatz/picolisp.jar | 0
Mlib.css | 4+++-
Msrc64/version.l | 4++--
5 files changed, 69 insertions(+), 46 deletions(-)

diff --git a/ersatz/fun.src b/ersatz/fun.src @@ -1,4 +1,4 @@ -# 18nov10abu +# 19nov10abu # (c) Software Lab. Alexander Burger # Ersatz PicoLisp Functions @@ -98,48 +98,48 @@ public (x y z s o) java (num i j k x y z s v o) y = (x = ex.Cdr).Car.eval(); if ((z = (x = x.Cdr).Car.eval()) == Nil || z instanceof Number) { + if ((s = (Symbol)y).Obj instanceof Boolean) + return ((Boolean)s.Obj).booleanValue()? T : Nil; + if (s.Obj instanceof Byte) + return new Number(((Byte)s.Obj).byteValue()); + if (s.Obj instanceof Character) + return new Number(((Character)s.Obj).charValue()); + if (s.Obj instanceof Integer) + return new Number(((Integer)s.Obj).intValue()); + if (s.Obj instanceof Long) + return new Number(((Long)s.Obj).longValue()); + if (s.Obj instanceof Double) + return strToNum(Double.toString(((Double)s.Obj).doubleValue()), xInt(z)); + if (s.Obj instanceof BigInteger) + return new Number((BigInteger)s.Obj); + if (s.Obj instanceof String) + return mkStr((String)s.Obj); x = Nil; - if ((s = (Symbol)y).Obj != null) { - if (s.Obj instanceof Byte) - x = new Number(((Byte)s.Obj).byteValue()); - else if (s.Obj instanceof Character) - x = new Number(((Character)s.Obj).charValue()); - else if (s.Obj instanceof Integer) - x = new Number(((Integer)s.Obj).intValue()); - else if (s.Obj instanceof Long) - x = new Number(((Long)s.Obj).longValue()); - else if (s.Obj instanceof Double) - x = strToNum(Double.toString(((Double)s.Obj).doubleValue()), evInt(ex.Cdr.Cdr)); - else if (s.Obj instanceof BigInteger) - x = new Number((BigInteger)s.Obj); - else if (s.Obj instanceof String) - x = mkStr((String)s.Obj); - else if (s.Obj instanceof byte[]) { - byte[] a = (byte[])s.Obj; - for (i = a.length; --i >= 0;) - x = new Cell(new Number(a[i]), x); - } - else if (s.Obj instanceof char[]) { - char[] a = (char[])s.Obj; - for (i = a.length; --i >= 0;) - x = new Cell(new Number(a[i]), x); - } - else if (s.Obj instanceof int[]) { - int[] a = (int[])s.Obj; - for (i = a.length; --i >= 0;) - x = new Cell(new Number(a[i]), x); - } - else if (s.Obj instanceof long[]) { - long[] a = (long[])s.Obj; - for (i = a.length; --i >= 0;) - x = new Cell(new Number(a[i]), x); - } - else if (s.Obj instanceof double[]) { - double[] a = (double[])s.Obj; - j = evInt(ex.Cdr.Cdr); - for (i = a.length; --i >= 0;) - x = new Cell(strToNum(Double.toString(a[i]), i), x); - } + if (s.Obj instanceof byte[]) { + byte[] a = (byte[])s.Obj; + for (i = a.length; --i >= 0;) + x = new Cell(new Number(a[i]), x); + } + else if (s.Obj instanceof char[]) { + char[] a = (char[])s.Obj; + for (i = a.length; --i >= 0;) + x = new Cell(new Number(a[i]), x); + } + else if (s.Obj instanceof int[]) { + int[] a = (int[])s.Obj; + for (i = a.length; --i >= 0;) + x = new Cell(new Number(a[i]), x); + } + else if (s.Obj instanceof long[]) { + long[] a = (long[])s.Obj; + for (i = a.length; --i >= 0;) + x = new Cell(new Number(a[i]), x); + } + else if (s.Obj instanceof double[]) { + double[] a = (double[])s.Obj; + j = xInt(z); + for (i = a.length; --i >= 0;) + x = new Cell(strToNum(Double.toString(a[i]), i), x); } return x; } diff --git a/ersatz/lib.l b/ersatz/lib.l @@ -1,4 +1,4 @@ -# 17nov10abu +# 19nov10abu # (c) Software Lab. Alexander Burger (on *Dbg) @@ -1062,6 +1062,7 @@ (repeat) ############ lib/debug.l ############ + # Browsing (de doc (Sym Browser) (let (L (chop Sym) C (car L)) @@ -1803,4 +1804,24 @@ (xmlrpcValue (caddr (assoc 'value L))) ) ) ) (cddr Lst) ) ) ) ) ) +############ lib/http.l ############ + +### HTTP-Client ### +(de client (Host Port How . Prg) + (let? Sock (connect Host Port) + (prog1 + (out Sock + (if (atom How) + (prinl "GET /" How " HTTP/1.0^M") + (prinl "POST /" (car How) " HTTP/1.0^M") + (prinl "Content-Length: " (size (cdr How)) "^M") ) + (prinl "User-Agent: PicoLisp^M") + (prinl "Host: " Host "^M") + (prinl "Accept-Charset: utf-8^M") + (prinl "^M") + (and (pair How) (prin (cdr @))) + (flush) + (in Sock (run Prg 1)) ) + (close Sock) ) ) ) + # vi:et:ts=3:sw=3 diff --git a/ersatz/picolisp.jar b/ersatz/picolisp.jar Binary files differ. diff --git a/lib.css b/lib.css @@ -1,4 +1,4 @@ -/* 07jul10abu +/* 18nov10abu * (c) Software Lab. Alexander Burger */ @@ -20,7 +20,9 @@ .em5 {width: 5em;} .em7 {width: 7em;} .em10 {width: 10em;} +.em15 {width: 15em;} .em20 {width: 20em;} +.em25 {width: 25em;} .em30 {width: 30em;} /* Defaults */ diff --git a/src64/version.l b/src64/version.l @@ -1,6 +1,6 @@ -# 18nov10abu +# 19nov10abu # (c) Software Lab. Alexander Burger -(de *Version 3 0 4 11) +(de *Version 3 0 4 12) # vi:et:ts=3:sw=3