newlisp.DLL possible?

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

Previous topic - Next topic

Lutz

#30
congratulations! nice demo, but ;)



(assoc 20 (list(list 20 "Dog")(list 30 "CAT")(list 40 "Mice")))



you could just do:



(assoc 20 '( (20 "Dog") (30 "CAT") (40 "Mice") )  )



or even



(assoc 20 '( (20 Dog) (30 CAT) (40 Mice) )  )



(just trying to present newLISP in a positive light)



Anyway, I am delighted by this demo of yours, as I think it will bring new friends to newLISP. There are so many tools on Windows for building GUI / Multi Media stuff where newLISP could be he 'intelligent' backend.



Lutz

HPW

#31
congratulations! great lisp language! ;-)



I will add your sugestions and also will put all lisp-samples in

an external lsp-file. Then you can add as much sample as you like.
Hans-Peter

HPW

#32
Now the lisp samples are in sample.lsp and have your suggestions.

I upload the 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
Hans-Peter

HPW

#33
I upload the new demo-exe with DLL 7.3.15 and a Fix in the demo to allow pipes in the sample lsp-file. (pipes are CR in native neobook fileread, so a plugin based own fileread is used)



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

#34
I just realize that error messaging is broken in the Win32 DLL in 7.3.15



Lutz

HPW

#35
Oops, did not notice anything.

So the next fix is needed. ;-)
Hans-Peter

Lutz

#36
in makefile_win32.dll replace



CC = bcc32 -O2 -DOPSYS=6     ;; wrong



with





CC = bcc32 -O2 -DOPSYS=6 -DWIN32DLL   ;; corect





and recompile the DLL.



I'll also put a recompile in the development directory



Lutz

HPW

#37
I upload the new demo-exe with recompiled DLL 7.3.15 and a Fix in the demo without a key-binding for '1' for the lisp-call button.



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

#38
yes, error messaging now works, I wonder if newLISP could be used to enhance  NeoBook apps, including controlling visual aspects of it?



Lutz

HPW

#39
>I wonder if newLISP could be used to enhance NeoBook apps, including controlling visual aspects of it?



Sure, you can do a lot of things, but not so dynamic as in TK. You can control navigation through neobook pages or modify/enable/disable objects. Filling listboxes, articels and Text-objects are possible. All math and string processing can be done. Everywhere you can define a callback-action you could jump into plugins. Commands from plugins simply enhance the neoscript language.



Dave from neosoft has true dynamic object on his list, but he had not decided, when and if they could appear. (next major release? I hope!).



I will look into some small lisp-functions to convert return data from newlisp into neobook list and arrays. neobook has some similar functions like freewrap to bind files into the EXE and unpack them at runtime. So this could be use to start the DLL and load some initial lisp files. Neobook can intergrate a lot of file-formats and plugins. The last DBF-plugin features a BLOB field where you can store any sort of file. So here is another point where you can store lisp-code.



So finally the user has to decide what solutiion fits best to get the job done. ;-)
Hans-Peter

Sammo

#40
Hello everyone,



I found my way here following Hans-Peter's lead from the NeoBook Forum.  In my first attempt at using the newLisp.DLL from NeoBook, I encountered what I perceive to be a problem in the documentation -- or in my understanding of the documentation.



Manual p.116 (parse str-data [str-break int-option])



"When str-break is not specified, the maximum token size is 2048 for quoted strings ....  If str-break is specified, there is no limitation on the length of tokens."



I wrote this:



;; long string with "%%" delimiters

(set 'mystring "string%%longer%%than%%2048%%charcters")

(parse mystring "%%") ==> string token too long



Have I misunderstood the documentaiton?  I don't think I should be getting the "string token too long" error.  The (parse ...) works perfectly for strings less than 2048 characters.

HPW

#41
Hello Sammo (or schould I say Sam),



Welcome on this forum.



May be Lutz give some explanation about your parse problem.

For your sample on the neobook forum I would made a different approach.

Instead of making a big string of a whole file in neobook and push it over the interface, I would do it on the newlisp side.



There I would read one line after another with read-line and

put them i a list and check each new line with (not(member ...))

before I put it into the list.
Hans-Peter

Lutz

#42
Welcome Sammo,



pasted everyting from your posting into the NeoBook demo (DLL based on 7.3.15) and it worked fine for me. I also tried it in the release version of newLISP v.7.3.1 and in the latest development version (7.3.15) and it also works ok, giving me a:



("string" "longer" "than" "2048" "charcters")



Are you sure your original did not miss a quote somewhere, that would also give you a "string too long error".



Lutz

Sammo

#43
Hi Lutz,



Thanks for the welcome and for responding so quickly.



I wasn't as clear as I could have been in my first post.  In my application, the string represented in the post by "string%%longer%%than%%2048%%charcters" is constructed by reading (in NeoBook) an entire file into a string, replacing the CR and LF pairs in the string with "%%", and then calling the parse function.  It works just fine until the length of the assembled string is greater than 2048 characters.  Because it works for strings shorter than 2048 characters, I'm pretty sure my quotes are balanced.  I haven't tried (parse ...) with a long string in the non-DLL version of newLISP.  It's possible (maybe even likely?) that Hans-Peter's interface is truncating long strings passed to the newLISP.DLL.



Taking Hans-Peter's hint, I have rewritten the code using a different approach.  I have a question about that, too, but I will start a new thread since the focus is different.



-- Sam

Lutz

#44
Hi Sam,



now I understand your > 2038 issue. The string to be parsed can be > 2048 bytes, but the resulting tokens still should be < 2048 bytes.



I just went to the neoforum and saw this from you:



>>>

.. Purpose: create [OutFile] consisting of just one copy of each unique line in [InFile]

<<<



Your code is correct, but you could do this in just one line of newLISP:



(write-file "OutFile" (join (unique (parse (read-file "InFile") "rn")) "rn"))



I tried this with the following file



>>>

one

one

two

two

one

three

two

three

<<<



and it gives me:



>>> outfile

one

two

three

<<<



(remark about >2048 bytes deleted, there is no limitations of string or token length in 'parse', when using with break string, 2002-12-07)



Lutz