unify and lists

Notices and updates
Locked
Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

unify and lists

Post by 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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

'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.

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Post by rickyboy »

Lutz wrote:[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
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

2D Graphics
Gets even more interesting what this will mean in practical.
;-)
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Gets 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
Posts: 248
Joined: Thu Sep 26, 2002 12:57 am

Post by Ryon »

Image
Is it here yet? Oh boy! Oh boy! Oh boy! Is it here yet? Oh boy! Oh boy!..

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

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

Locked