newLISP Fan Club

Forum => newLISP newS => Topic started by: Dmi on June 01, 2007, 07:46:52 AM

Title: unify and lists
Post by: Dmi on June 01, 2007, 07:46:52 AM
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))
Title:
Post by: Lutz on June 01, 2007, 08:31:05 AM
'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



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.
Title:
Post by: rickyboy on June 01, 2007, 10:17:23 AM
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!  :-)
Title:
Post by: HPW on June 01, 2007, 10:21:58 AM
Quote2D Graphics


Gets even more interesting what this will mean in practical.

;-)
Title:
Post by: Lutz on June 01, 2007, 10:41:35 AM
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
Title:
Post by: Ryon on June 01, 2007, 10:55:38 AM
(//%3C/s%3E%3CURL%20url=%22http://alh.net/newlisp/wiki/pix/hombenny4_e0.gif%22%3Ehttp://alh.net/newlisp/wiki/pix/hombenny4_e0.gif%3C/URL%3E%3Ce%3E)

Is it here yet? Oh boy! Oh boy! Oh boy! Is it here yet? Oh boy! Oh boy!..
Title:
Post by: Dmi on June 03, 2007, 09:19:43 AM
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 :-)