newlisp.DLL possible?

Started by HPW, October 13, 2003, 12:30:58 PM

Previous topic - Next topic

Sammo

#45
Thank you, Lutz



That worked dandy!  Here's the entire NeoBook program now using HPW's conduit to the newLISP.DLL.  You'll notice that I replaced rn with [#13][#10] -- NeoBook's syntax for representing ASCII character values.  It just wouldn't work with rn or even \r\n.


SetVar "[InFile]" "[PubDir]Data1.txt"
SetVar "[OutFile]" "[PubDir]Data2.txt"
SetVar "[LispCode]" "(write-file {[OutFile]} (join (unique (parse (read-file {[InFile]}) {[#13][#10]})) {[#13][#10]}))"
hpwNewLispCall "[PubDir]" "[LispCode]" "[LispResult]"


Thank you, again.

-- Sam

Lutz

#46
I am glad newLISP 'is doing it' for you with NeoBook. The different  representation of binary characters is always a hassle to work with, but it seems that NeoBook is applying its translation from [#13] correctly and you found out about {,} for string delimiters, you also can use {,} inside {,} as long as they are balanced.



Another string delimiter in newLISP is [text] and [/text], these are used for strings longer than 2048 bytes and newLISP also uses them when returning quoted strings to the user.



Lutz

Sammo

#47
Thank you again, Lutz, for the help and for the pointer to the updated manuals.  I will be studying them.  newLISP is going to be lots of fun!

Sammo

#48
With regard to my earlier work-around of replacing "rn with [#13][#10]" in the NeoBook shell, I find in the manual that "[c]urly braces suppress the preprocessing of backslash escaped characters."  That explains that!

HPW

#49
Sam,



Glad to know that it was an easy explanation to the problem.

Now it is even shorter than your workaround. Lutz has made a really great job on newLISP.

May the workaround will provide ideas for future problems, which could not be done with unique.



>It's possible (maybe even likely?) that Hans-Peter's interface is truncating long strings passed to the newLISP.DLL.



No, to my current knowledge there is no limitation. The string is stored into memory and only a pointer is passed through the interface.



When Lutz has fixed the bug on (silent ) there will be a 1.01 of the interface with another very, very cool feature. ;-)



Stay tuned!
Hans-Peter

Lutz

#50
the new development release 7.3.16 has the 'silent' bug fixed.



About the >2048 issue. Longer >2048 results strings from newLISP come back not quoted by "..." but by [text]... [/text] tags, I wonder if that could do something funny to the NeoBook interface which seems to treat [,] square brackest as some sort of escape/special character?



Lutz

HPW

#51
Just released release 1.01 of the newlisp-wrapper for neobook:



See Froum post:



http://www.neosoftware.com/cgi-bin/ikonboard/topic.cgi?forum=3&topic=390">http://www.neosoftware.com/cgi-bin/ikon ... &topic=390">http://www.neosoftware.com/cgi-bin/ikonboard/topic.cgi?forum=3&topic=390



Updated plugin-page:



http://hpwickern.bei.t-online.de/anmeldung/html1/neobook/neobook.html">http://hpwickern.bei.t-online.de/anmeld ... obook.html">http://hpwickern.bei.t-online.de/anmeldung/html1/neobook/neobook.html



I upload a new demo-exe of the release demo to my plugin-page:



http://hpwickern.bei.t-online.de/anmeldung/html1/neobook/hpwNewLISPDemo.zip">http://hpwickern.bei.t-online.de/anmeld ... SPDemo.zip">http://hpwickern.bei.t-online.de/anmeldung/html1/neobook/hpwNewLISPDemo.zip



Features:

Action: hpwNewLispCall - Support for callbacks in return-messages into neoScript!

Support-file: nb_util.lsp with usefull functions. Starts with: (nl2nb-list '("1" "2" "3"))

Demo-file: neoTurtle.lsp with fractal-graphics in neobook powered by newLISP/hpwImage.

Last but not least: newlisp.dll Development version 7.3.16
Hans-Peter

HPW

#52
>I wonder if that could do something funny to the NeoBook interface which seems to treat [,] square brackest as some sort of escape/special character?



The brackets mark variables in neobook and have indeed to be treated different. I thought Sam has it working now.





May be we have to check again.
Hans-Peter

Sammo

#53
Hi Hans-Peter and Lutz,



I do have it (my program to copy just the unique lines in a text file) working now.  All of the work is done in newLISP (thanks, Lutz!) and I am not passing lengthy strings back to NeoBook.  I think the problem was that I was unaware of the [text]...[/text] requirement for lengthy strings and so was passing to a newLISP function a >2048 string delimited with double-quotes.  I will verify this by returning to my old code and using [text]...[/text] in place of double-quotes.  If this proves to be the culprit, we can document it for neoBook coders.



Verified! Using [text]...[/text] in neoBook when passing >2048 strings to newLISP eliminated the "string too long" error.





-- Sam

HPW

#54
I uploaded a polished demo-exe of the release demo to my plugin-page:



http://hpwickern.bei.t-online.de/anmeldung/html1/neobook/hpwNewLISPDemo.zip">http://hpwickern.bei.t-online.de/anmeld ... SPDemo.zip">http://hpwickern.bei.t-online.de/anmeldung/html1/neobook/hpwNewLISPDemo.zip
Hans-Peter

Lutz

#55
where did the turle demo go? I loved th turtle port you did, and thought I would see the Hanoi demo in the next NeoBook demo ;). There might be a problem though with the Hanoi demo, because the disk deletion works there by deleting a TK graphic object. I don't know if it is possible to do that with NeoBook.



Anyway, why don't you put it back (load "neoTurtle.lsp") doesn't work, I guess it doesn't find a graphic context to draw to.



Lutz

HPW

#56
Dont't know what you mean, when you enter the turtle page it is loaded automaticly. You have to press the 'Start Lisp' button to start the string '(Turtle:run) in the entry field. The articel-object is just there to show the source. I only want to show what is done behind the scene.



To the Hanoi demo, the hpwImage plugin is a scriptable bitmap object, which does not work with objects like TK. Of cource it could be done with a complete redraw each time. Will take a look.
Hans-Peter

Lutz

#57
Oops, sorry about it! I always extracted an old version, this latest one is beautiful with the source pane on the right! This NeoBook software looks better to me each time you have a new demo.



About Hanoi: What I did in an older version, was overdraw the disk with 'white' to delete it.



Lutz

HPW

#58
Many people (like high-flying MS-User ;-)) think neobook is a toy-tool.

Of cource a Visual studio might be better for huge projects and programmer teams. But Dave has really made a RAD-tool which can produce very nice results in less time. And through it's SDK you get an interface to extent the core-functionality.



>About Hanoi: What I did in an older version, was overdraw the disk with 'white' to delete it.



That was what I mean. The problem with the the neobook interface is, that it is not truly bidirectional. There are not 2 independent running process which communicate via TCP, there is one call into it and the answer has to contain the complete result neoscript. So with Hanoi, newlisp is ready when neobook starts painting. Will see how it will work.
Hans-Peter

HPW

#59
Another idea would be to break it into parts and call it in a neobook loop and update the screen in this loop with subsequent calls for the disk position. Must be also possible.
Hans-Peter