Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - HJH

#1
Quote from: "aron"


All ideeas are wery appreciateed


Well, perhaps

http://www.newlisp.org/DesignPatterns.html#text_processing">http://www.newlisp.org/DesignPatterns.h ... processing">http://www.newlisp.org/DesignPatterns.html#text_processing



is a start.



--HJH
#2
Anything else we might add? /
October 18, 2005, 12:35:34 PM
Lutz,



Thank you for your explanations which I could use readily. A dictionary is a separate context where  the symbols correspond to the keys of the dictionary which are bound to values. The way how to construct an access symbol was unfamiliar to me but now I understand how it works.



--HJH
#3
Anything else we might add? /
October 17, 2005, 06:44:33 AM
Well in the mean time I found the answer in the manual



I can use the following three predicates:

http://www.newlisp.org/downloads/newlisp_manual.html#assoc">http://www.newlisp.org/downloads/newlis ... html#assoc">http://www.newlisp.org/downloads/newlisp_manual.html#assoc


replace-assoc
and
lookup.



So the only question remaining is how to remove an existing entry.



--HJH
#4
Anything else we might add? /
October 17, 2005, 06:36:22 AM
A JSON parser is a contribution which is very welcome.

Did anybody else use and test the code?



Is it as well possible to write JSON files?



--HJH
#5
Hello



I have been reading the passage http://www.newlisp.org/DesignPatterns.html#text_processing">http://www.newlisp.org/DesignPatterns.h ... processing">http://www.newlisp.org/DesignPatterns.html#text_processing of the newlisp design patterns document. For me the paragraph about text processing is too terse and I do not really understand how to implement a dictionary.



For example I would like to implement the example given under  http://en.wikipedia.org/wiki/Associative_array#Lisp">http://en.wikipedia.org/wiki/Associative_array#Lisp.

(It shows how to use a dictionary/associative array in various languages. The example shown has  name as key and  phone number as value attribute).



How do I create a dictionary/associative array in newlisp?



How do I access the value of a certain key element?



How do I add a new entry?



How do I remove an entry?



How do I get a list of all keys?





If somebody already has some code snippets / comments explaining this issue that would be a great help. Thanks in advance.



--HJH
#6
Anything else we might add? /
September 20, 2005, 07:13:57 AM
Quote from: "Excalibor"Nice article...



I've tinkered with Pico Lisp some time ago, and it seemd a very pragmatic and nice solution... In a way, it's like newLisp, in others, it's not...




Where do you see the similarities to newLisp? Where do they differ?



The article shows an intersting statistic where the interpreted picoLisp is much faster than a compiled Lisp (CLisp). At least this shows that the interpreted vs. compiled question isn't an issue anymore.



--HJH
#7
Anything else we might add? /
June 16, 2005, 10:44:54 AM
Thank you for this links to the design patterns page. It is very useful. I was not aware of it.



A suggestion for the future:



A section of a side by side comparison of some of the more prominent patterns with COMMON LISP would be useful. I am currently learning COMMON LISP (CLISP and ACL) as well so I am willing to contribute if I am pointed to the right spots where to start working out the differences.



A nice thing would be as well something like a "bilingual dictionary" which gives the translations (or only rough equivalents if there is a difference in meaning) between the predicates and function of newLisp and COMMON LISP. Even an incomplete list will be helpful. I am currently only using 30 functions / predicates of newLisp and can do useful things with it.



My aim is to translate the script I just did to COMMON LISP because I would like to get a feeling to see how different it is and to give it to people who probably are not willing to experiment with newLisp.



I may post this 30 word lists of functions / predicates, if you like.

(it is about file IO, list manipulation and string manipulation. With these functions you can already accomplish a lot in general data processing or more precisely - scripting).



--HJH





BTW Has somebody a newLisp function which takes the name of a newLisp source file as input and produces a statistics of the built-in predicates used?

(the result beeing a list of key-value paris; the key is newLisp predicate/function, value is the number of times the thing is used)
#8
newLISP in the real world /
June 15, 2005, 06:23:16 AM
Yes, thank you all for your answers.



In fact the dialog is produced, but it does not show up. The only thing that something happens is a new entry in the taskbar where people do not normally check regularily for new things. So from a usability point of view it is useless.



But let's not use more time with this issue. I just write a text log file as feedback and (exit) newlisp. If I want to do a GUI app I'll stick to the 1.2MB newlisp-tk-combination.



--HJH
#9
newLISP in the real world /
June 14, 2005, 02:17:43 PM
Why does
(import "user32.dll" "MessageBoxA")

(MessageBoxA 0 "Content" "Caption" 0)

not work in newlisp.exe (210kB exe)?



--HJH
#10
Hi



there is

print println write-line



but how do I write a string to a file without sending out a  standard  line termination character?



--HJH
#11
newLISP in the real world /
June 13, 2005, 08:28:56 AM
It works fine in the 1.4MB  newlisp-tk.exe but not in the 210kB newlisp.exe



--HJH
#12
newLISP in the real world /
June 13, 2005, 01:49:00 AM
Quote from: "HPW"...It still works as before with link.lsp

and show the icon in the command-window and the task-bar.



So exactly what you want.


Yes, indeed. I use this approach now. I just do a backup copy of the original 'newlisp.exe' to have it handy for the next time. Thank you for this recommendation!




Quote from: "HPW"So we can make nice small tool with their own icon. Of cource still a command-line interface!


Yes, but often command line tools are just good enough; I collect a couple of file, do some minor processing and write out a result file and a log file. Just the things script languages are meant for.



Of course it would be nice to give the user a visual feedback as well by showing a standard Windows message box ("Success" or "Failure, see log file").



Alex has a nice example using a Win32 function call from (import "kernel32.DLL" "GetStdHandle")

See entry http://www.alh.net/newlisp/phpbb/viewtopic.php?t=688">//http://www.alh.net/newlisp/phpbb/viewtopic.php?t=688



So it seems it would not be too difficult to call other Win32 functions.



Has somebody the calling sequence just ready? (copy / paste)?



--HJH
#13
Hello



I successfully used on a command promptnewlisp link.lisp (see http://www.newlisp.org/downloads/newlisp_manual.html#linking">//http://www.newlisp.org/downloads/newlisp_manual.html#linking to create a 211kB-non-GUI-MSWindows executable with a newLisp script I wrote.



It is fantastic how easy it is, to create small handy stand-alone Windows apps doing a particular task. (And the installation then is just copy/paste an exe).



My question: Is it possible to add an icon file myIcon.ICO during the linking process?



If I construct several of these programs that would be useful to be able to distinguish them by the icon.



--HJH
#14
Anything else we might add? /
June 06, 2005, 08:18:54 AM
Thank you for the answer. In fact for me the second version with passing the large data structure (the data base list) as a symbol is easier to understand.



--HJH
#15
Hi



I have a general question of understanding

after having read

http://www.newlisp.org/MemoryManagement.html">//http://www.newlisp.org/MemoryManagement.html



It seems that parameters are always passed by value to the functions. This means that a parameter value is copied, i.e. duplicated, when calling a function. This seems to be the case even for lists.



So if I have a function with a list as an argument which calls itself recursively let's say 50 times, do I have then 50 times a copy of the same list in the memory? Or am I missing something?



Thank you for the answer in advance

--HJH