Re: Mini http server

2011-06-30 Thread Alexander Burger
Hi Henrik, The goal is also to have something that can be loaded after/instead of http.l when you want a simple web server without the fancy stuff. OK. (redef httpHead (Typ Upd File Att) (http1 Typ Upd File Att) (and *Chunked (prinl Transfer-Encoding: chunked^M)) (prinl ^M) )

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 Alexander Burger
Hi Doug, 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 ) ) I didn't test it, but I think the construct using 'solve' is more complicated than necessary. At

Re: pilog: unification in variables that are clauses

2011-06-30 Thread Alexander Burger
On Thu, Jun 30, 2011 at 09:20:43AM +0200, Alexander Burger wrote: At least, a simple (@ . @A) should work. Doesn't it? Wait ... probably not a good idea. But this should work: (@ - @A) -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

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 Alexander Burger
Hi Doug, (be holds (@A @S) (or ((restoreSitArg @A @S @F) (@ - @F)) ((not (restoreSitArg @A @S @F)) (isAtom @A) (@ - @A)) ) ) gives me the same results as using the (@ solve (list (- @F))) clause. Neither that nor (@ - @F) seem to unify variables in @F (which is bound to a

interesting observations about bugs

2011-06-30 Thread Terry Palfrey
http://itunes.apple.com/ca/podcast/the-stack-exchange-podcast/id279215411

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

2011-06-30 Thread Alexander Burger
Hi dexen + all, I accepted the challenge, and posted a new task to RosettaCode: http://rosettacode.org/wiki/First_class_environments The PicoLisp solution is quite clean, IMHO. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

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