unify and lists

Started by Dmi, June 01, 2007, 07:46:52 AM

Previous topic - Next topic

Dmi

Is there a way to implement something like:

(unify (f A B TAIL) (f g h i j k)) => ((A g) (B h) (TAIL (i j k l))
WBR, Dmi

Lutz

#1
'unify' in newLISP should (an is) using unification rules as defined in math and computer science. Read more about it here:

http://en.wikipedia.org/wiki/Unification">http://en.wikipedia.org/wiki/Unification



You are probably  thinking of the p([H|T]) mechanism offered in Prolog. If it is possible to implement this using the same three [ | and ] characters and without disturbing the existing rules that would be a nice thing to have, but is further down on my to-do list as there are so many other things to do in the mext months to come (finishing GUI functionality then 2D Graphics) and not to forget about XML call backs, curry-nth etc.  ;)



Lutz.



ps: classic Prolog (implemented in Lisp) implements this on top of unify, calling it recursevely on sub terms.

rickyboy

#2
Quote from: "Lutz"[T]here are so many other things to do in the [n]ext months to come (finishing GUI functionality then 2D Graphics) and not to forget about XML call backs, curry-nth etc.  ;)

Go Lutz, go!  :-)
(λx. x x) (λx. x x)

HPW

#3
Quote2D Graphics


Gets even more interesting what this will mean in practical.

;-)
Hans-Peter

Lutz

#4
QuoteGets even more interesting what this will mean in practical


draw-line, draw-rectangle, darw-circle, set-line-width, set-line-color, etc. Basically the functionality we had in the Tcl/Tk interface with drawing on a canvas, including handling of mouse movements, clicks etc., plus some image and bitblock-transfer handling capabilities and all anti aliased and transparent colors (have those already in the GUI stuff).



The same demos (hanoi.lsp, turtle.lsp etc) can than be shipped with the new release, but now looking a lot nicer and re-written using a newLISP API.



Lutz

Ryon

#5
http://alh.net/newlisp/wiki/pix/hombenny4_e0.gif">

Is it here yet? Oh boy! Oh boy! Oh boy! Is it here yet? Oh boy! Oh boy!..
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Dmi

#6
Just about unify ;-)

I has trying to decide how can I parse syntactical sequence and can I use unify for that.

And I've found a little problem here :-)



Not very important, at this time... We all waiting for the already declared features :-)
WBR, Dmi