Re: Concurrency

2009-10-09 Thread Doug Snead
--- On Fri, 10/9/09, Tomas Hlavaty t...@logand.com wrote:=0A How many pro= cesses do you need?=A0 I can fork about 500=0A from one parent=0A (limite= d by my OS set up).=A0 And because picolisp is,=0A well, pico, it=0A do= esn't take much memory (picolisp uses less that 2MB).=0A=0AAnd if picolisp

Re: script for generating tags for picolisp

2010-08-17 Thread Doug Snead
Here's one shell script I used to use for that (I called it lisptags) ... hopefully it still works :-) #!/bin/sh # make a tags file for pico lisp source files. # use: # lisptags foo.l bar.l baz.l ... bof.l # generate the file 'tags' # [based on lisptags csh script by John Foderaro,

golog in minipicolisp ?

2011-06-17 Thread Doug Snead
Alexander (or anyone!), I'm looking at something called golog http://www.cs.toronto.edu/cogrobo/main/systems/index.html it is a A high-level agent programming language... based on Prolog (usually Eclipse, SWI, LPA, and Quintus.) An interpreter in SWI Prolog can be found here.

Re: embedding minipicolisp

2011-06-20 Thread Doug Snead
Ok, here's my first attempt at using minipicolisp as a library. (Leaving aside the issue of get/put for now. Basically replacing main() with: #if !LIBRARY /*** Main ***/ int main(int ac, char *av[]) { char *p; . . . #else // we're building as a library void miniPicoLisp_init( const

Re: embedding minipicolisp

2011-06-22 Thread Doug Snead
Hi Alexander, Ha! That last code snippet got me to where I needed to get :-) THANKS!! (Now when I close my eyes I see pilog - what does that mean?) Cheers, Doug --- On Wed, 6/22/11, Alexander Burger a...@software-lab.de wrote: From: Alexander Burger a...@software-lab.de Subject:

Re: golog in minipicolisp

2011-06-26 Thread Doug Snead
--- On Sun, 6/26/11, Doug Snead semaphore_2...@yahoo.com wrote: (be isAtom (@A) (not (equal @A (Neg @W)))     (or (equal @A (And @W1 @W2)))         (or (equal @A (If @W1 @W2)))      (or (equal @A (Is @W1 @W2)))     (or (equal @A (Or @W1 @W2)))     (or (equal @A (some @X @W

Re: tracing pilog

2011-06-26 Thread Doug Snead
Thanks Alex!The more I look at it, the more I like pilog for golog because golog uses prolog-ish backtracking so heavily. When I look at this attempt to make a lua golog for example http://drops.dagstuhl.de/opus/volltexte/2010/2631/pdf/10081.Ferrein.2631.pdf , I think a picolisp/pilog

Re: tracing pilog

2011-06-26 Thread Doug Snead
This is exactly what I was looking for, thanks! --- On Sun, 6/26/11, Alexander Burger a...@software-lab.de wrote: It works by simply passing the names of the clauses you want to trace right after the '?' (i.e the ['sym' ..] arguments). ... With tracing    : (? append (append (a b c) @X (a b

pilog question

2011-06-29 Thread Doug Snead
I have a question about how or/2 works in pilog. Here's my test of or/2: ~/lisp/miniPicoLisp $ ./pil : (be a (3)) - a : (be b (3)) - b : (? (a 3)) - T : (be foo (@N) (or (a @N) (b @N))) - foo : (? foo a b or (foo 3)) 1 (foo 3) 1 (or (a 3) (b 3)) - NIL : Shouldn't that be T ? It seems to

and/2 another pilog question

2011-06-29 Thread Doug Snead
More pilog adventures! Alex, would it be possible to give pilog an and/2 rule similar to the or/2 rule that pilog has now? Sometimes refactoring pilog around the lack of an and/2 is a pain. Here's an example, where a rule has a kind of a logical expression (with prolog backup):

Re: and/2 another pilog question

2011-06-29 Thread Doug Snead
Ha! The and is implicit ... I should seen that - the or/2 example there was a clue. Thanks for the assistance!! I feel close to getting golog (and elevator example) working. Cheers, Doug --- On Wed, 6/29/11, Alexander Burger a...@software-lab.de wrote: From: Alexander Burger

pilog: unification in variables that are clauses

2011-06-30 Thread Doug Snead
--- On Wed, 6/29/11, Alexander Burger a...@software-lab.de wrote: So this should be written as (be holds (@A @S) (or ((restoreSitArg @A @S @F) (@ solve (list (- @F ((not (restoreSitArg @A @S @F)) (isAtom @A) (@ solve (list (- @A ) ) holds(A,S) :- restoreSitArg(A,S,F), F ;

Re: pilog: unification in variables that are clauses

2011-06-30 Thread Doug Snead
Hi Alex, Thanks for your help! holds(A,S) :- restoreSitArg(A,S,F), F ; \+ restoreSitArg(A,S,F), isAtom(A), A. What I really want is this: (be holds (@A @S) (or ((restoreSitArg @A @S @F) @F) ((not (restoreSitArg @A @S @F)) (isAtom @A) @A) ) ) But the above (with a @F or

Re: pilog: unification in variables that are clauses

2011-06-30 Thread Doug Snead
Here's the issue boiled down to a simpler test case :-) First, swi-prolog: # cat t.pl a(3). foo(N) :- N. bar(a(X)) :- a(X). # swipl -f t.pl % /root/prolog/t.pl compiled 0.00 sec, 2,800 bytes ... ?- trace. true. [trace] ?- bar(a(Z)). Call: (6) bar(a(_G386)) ? creep Call: (7)

Re: Picked from HN: `First-class environments.'

2011-06-30 Thread Doug Snead
Nice! I like that site rosettacode.org lots. (I stopped counting how many computer 'languages' I have assimilated over the years!) This example again shows off picolisp/pilog nicely. http://rosettacode.org/wiki/24_game/Solve#PicoLisp I think the perl solution may be a tad smaller. But

Re: pilog: unification in variables that are clauses

2011-06-30 Thread Doug Snead
The solve way seems to some closest to doing it. ~/lisp/miniPicoLisp $ cat t.l (be a (3)) (be foo (@C) # (@C - @C) # (call @C) (@ print (solve (list (- @C ) $ ./pil t.l : (? a foo (foo (a @Z))) 1 (foo (a @Z)) (((@Z . 3)))- T So I can see that it is correctly solving for @Z this

Re: pilog: unification in variables that are clauses

2011-07-01 Thread Doug Snead
Thanks Alex!!! We have golog in pilog. Er, I think :-) If not we're pretty dang close. Still trying to get the simple elevator example going from Knowledge in Action as a test. http://www.cs.toronto.edu/cogrobo/kia/simpleElevator http://books.google.com/books?q=%22proc%28goFloor%22 etc.

pilog question

2011-07-04 Thread Doug Snead
Consider these five pilog assertions. (be do ((Question @P) @S @S) (holds @P @S)) (be holds (@A @S) (restoreSitArg @A @S @F) (2 cons (- @F))) (be On (3 s0)) (be On (5 s0)) (be restoreSitArg ((On @N) @S (On @N @S))) I define some tests. (de t_1 () # ok (? holds On restoreSitArg (holds

Re: pilog question

2011-07-04 Thread Doug Snead
Thanks Alex! I ended up taking it up to (5 cons (- @F)) to get the first simple elevator example working. Still a bit wonky in that respect. (Might have to adjust that magic unification level number per application!) But this definitely shows golog pilog is possible. Here's a page where

Re: pilog question

2011-07-04 Thread Doug Snead
04, 2011 at 12:26:46AM -0700, Doug Snead wrote: Consider these five pilog assertions. (be do ((Question @P) @S @S) (holds @P @S)) (be holds (@A @S)     (restoreSitArg @A @S @F)     (2 cons (- @F))) (be On (3 s0)) (be On (5 s0)) (be restoreSitArg ((On @N) @S (On @N @S

Re: pilog question

2011-07-05 Thread Doug Snead
Hi Alex, Ah, the situation is not so bad IMO. To begin with, this is an obscure thing to do, I think - maybe somewhat pedantic. It forces golog to be prolog, in a sense. And there are workarounds which you provided. And I think you're right: it should be possible to restructure the involved

android picolisp using ndk/jni

2011-07-07 Thread Doug Snead
http://developer.android.com/sdk/ndk/overview.html : Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on. Ok, here's a plan for :-) a real Android picolisp ... start by taking

heap miniPicoLisp question

2011-07-13 Thread Doug Snead
~/build/miniPicoLisp # ./pil : (heap) - 1 : (heap T) - 0 : Shouldn't I see something else - or is that correct for miniPicoLisp ? Cheers, Doug -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

pilog: Prolog Tutorial, 2.19 Actions and plans

2011-07-15 Thread Doug Snead
Here's another prolog-to-pilog translation, this time from John Fisher's excellent Prolog Tutorial, 2.19 Actions and plans http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_19.html prolog: http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_19pl.txt to pilog:

Re: The PicoLisp Ticker

2011-07-15 Thread Doug Snead
I think you created a bot-trap :-) --- On Fri, 7/15/11, Alexander Burger a...@software-lab.de wrote: From: Alexander Burger a...@software-lab.de Subject: The PicoLisp Ticker To: picolisp@software-lab.de Date: Friday, July 15, 2011, 12:58 AM Hi all, let me share my funny experiences

re: Ninety-Nine Lisp Problems: pilog

2011-07-15 Thread Doug Snead
re: the 24jul10 comment: The more of the higher-numbered problems... are really typical Prolog problems! All of them involve recursive searches in some solution space. http://picolisp.com/5000/-2-1K.html Then perhaps picolisp's Prolog (pilog) would be ideal? I'm always happy to see pilog

pilog and Definite Clause Grammar (DCG)

2011-07-19 Thread Doug Snead
Alex (or anyone), What's the best way to handle Definite Clause Grammar syntax in pilog? Definite Clause Grammar (DCG) and Prolog supports a special rule syntax for writing DCGs. The syntax is simpler, much closer to the syntax one uses in writing context-free grammar rules. When using the

Re: pilog and Definite Clause Grammar (DCG)

2011-07-20 Thread Doug Snead
THANK YOU! I haven't tested that yet but I think that is exactly what I was looking for there. Might be something to consider adding to pilog.l Seems to be fairly standard in prologs - and useful for creating parsers :-) Beautiful code, thanks again so much! Cheers, Doug --- On Wed,

Re: pilog dcg with args

2011-07-27 Thread Doug Snead
Hi Alex, Thanks for the picolisp pointers :-) The sub? shrinks down one of the awkward bits there. Unfortunately, I didn't see sub? in miniPicoLisp. The replace seems like a better idea than using the surgical patch there - probably not a good idea to modify a list passed in as an argument

error message line numbers

2011-09-04 Thread Doug Snead
Hi Alex, Is there a way I can make (mini)PicoLisp give me line numbers from .l source files in error messages? There are lots of gnu and/or linux tools (like vim) and IDEs etc., that want error messages in a format similar to what gcc spits out, like: Baz.cpp:321: error: 'foobar' was not

Re: error message line numbers

2011-09-06 Thread Doug Snead
Thanks for the reply, Alex. I need to use Windows without cygwin dlls for an application I'm working on now. So, I had been using miniPicoLisp in my application, which compiles ok under mingw. That let me avoid even trying to compile regular PicoLisp using mingw, and the porting issues

re: tags

2011-11-14 Thread Doug Snead
FWIW ... here's something I use instead of ctags for picolisp. $ cat /usr/local/bin/lisptags #!/bin/sh # make a tags file for pico lisp source files. # use: # lisptags foo.l bar.l baz.l ... bof.l # generate the file 'tags' # [based on lisptags csh script by John Foderaro, c.1982] awk '

Re: PicoLisp is DEAD (Was: PicoLisp and its (lack of) libraries)

2012-01-23 Thread Doug Snead
--- On Mon, 1/23/12, Jakob Eriksson ja...@aurorasystems.eu wrote: The Java version opens up the path to Android jobs - and I have an impression that those are still a kind of Wild West. I have a (slightly hacked) version of miniPicoLisp running as an android native library as a proof of

Re: PicoLisp is DEAD (Was: PicoLisp and its (lack of) libraries)

2012-01-24 Thread Doug Snead
Date: Monday, January 23, 2012, 11:47 PM On January 24, 2012 at 7:49 AM Doug Snead semaphore_2...@yahoo.com wrote: I have a (slightly hacked) version of miniPicoLisp running as an android native library as a proof of concept.  No no additional java interpretation penalty

miniPicoLisp Trasnients

2012-01-25 Thread Doug Snead
Alex, I have a porting-related question for you. After more android testing I'm finding a problem with (transient) variables ... (I think). When I try a definition like this, (de foo (x) x) no problem, (foo 123) returns 123 as expected. But when I try it this way: (de baz (X) X)

Re: miniPicoLisp Transients

2012-01-26 Thread Doug Snead
--- On Thu, 1/26/12, Alexander Burger a...@software-lab.de wrote: (setq V 456) at the top level (not in a definition) that works as expected Again strange. It shouldn't matter how the symbol is used (globally or bound locally). Hi Alex, Thanks for the guidance! On second look, I was

android success with full picolisp

2012-02-20 Thread Doug Snead
More android + picolisp fun, this time with the full picolisp.  Using the android SDK and NDK, I hacked a picolisp/src/makefile to work for android's arm processor like this: --- makefile --- [snip] CFLAGS := -c -O2  -pipe \         -falign-functions=64 -fomit-frame-pointer

Re: server - IP socket error: Address family not supported by protocol

2012-02-22 Thread Doug Snead
? --- On Wed, 2/22/12, Doug Snead semaphore_2...@yahoo.com wrote: From: Doug Snead semaphore_2...@yahoo.com Subject: server - IP socket error: Address family not supported by protocol To: picolisp@software-lab.de Date: Wednesday, February 22, 2012, 10:07 PM Hi Alex, I'm tying to get

Re: server - IP socket error: Address family not supported by

2012-02-22 Thread Doug Snead
Hi Alex, Ah, ok ... hmmm, that's two different platforms I have seen that problem on, then. The Android NDK also compiles the latest picoLisp ok, but then, same as that other (more standard) linux, dies in that port function with the same error. I can drop back to a pre-IPv6 version of

Re: Android Web Server

2012-02-24 Thread Doug Snead
Hi Joe, Very nice!   I think it would be useful to be able to package complete picolisp applications as android apps. Or, at least that might be a possibility.  Something to explore. I'm still hung up on trying to get android browser to talk to the picolisp app server like that.  I'm reading

Re: pilog in ersatz

2012-07-09 Thread Doug Snead
The pilog trace can be helpful in these situations. : (be bigger (me her)) : (be bigger (her son)) : (be bigger (son daughter)) : (be bigger (@x @y) (bigger @x @z) (bigger @z @y)) List the assertions you want to trace before the clause to be proved, in this case bigger : : (? bigger (bigger @x

Re: pilog in ersatz

2012-07-09 Thread Doug Snead
--- On Sun, 7/8/12, Christophe Gragnic christophegrag...@gmail.com wrote: : (be bigger (me her)) - bigger : (be bigger (her son)) - bigger : (be bigger (son daughter)) - bigger : (be bigger (@x @y) (bigger @x @z) (bigger @z @y)) - bigger : bigger - NIL : (? (bigger @x meily)) @x=alix

Re: Android Demo

2012-10-10 Thread Doug Snead
: From: Thorsten Jolitz tjol...@googlemail.com Subject: Re: Android Demo To: picolisp@software-lab.de Date: Tuesday, October 9, 2012, 10:06 AM Doug Snead semaphore_2...@yahoo.com writes: Hi Joe and Doug, I read up your conversations about PicoLisp on Android in the mailing list and your

Re: Announce: PicoLisp in Hardware (PilMCU)

2014-09-21 Thread Doug Snead
Oh boy! I've been thinking of something like this for a while. What is the low-hanging fruit here, in the sense of, what applications might we do faster/cheaper/better in hardware like this, than can be done otherwise? The idea of pilog in hardware excites me too ... maybe time to go back