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

Topics - HPW

#1
Hello Lutz,



I ran across this error:



> (setq 01Text "Some Text")

ERR: missing argument in function setf


So is this not allowed to use a symbolname starting with a number?



Using: 10.7.4 32Bit Exe



Also showing in DLL-Flavour.



Regards



Hans-Peter
#2
newLISP newS / Forum is back again
May 30, 2020, 11:22:22 PM
Hello Forum-admin,



Just noticed that the forum is back to full power.

Many thanks to you for your ongoing support and providing this great resource of the newlisp community.



Regards

Hans-Peter
#3
Hello,



I get this unexpected result in round:

> (round 8.3 -1)
8.300000000000001
> (round 8.30 -1)
8.300000000000001
> (round 8.430 -1)
8.4
> (round 8.4 -1)
8.4
> (round 8.2 -1)
8.199999999999999
>


The doc contains not this behaviour.



Regards

Hans-Peter
#4
newLISP in the real world / csv to assoc-list
January 24, 2019, 11:06:17 PM
Hello,



Inspired by this thread:

http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=4918&p=24159&hilit=csv#p24159">http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=4918&p=24159&hilit=csv#p24159



Using the artful-newlisp-master/csv.lsp I get a proper list.



The first sublist contains the column header names.



Now I want to transform the list to a assoc-list where the column header names get inserted in each other line as a assoc-key:



So ("Colname1" "Colname2" ....)

and

Lines (Val1 Val2 ....)

gets

(("Colname1" Val1)("Colname2" Val2) ...)



What is the shortest/best approach?



Regards



Hans-Peter
#5
newLISP in the real world / newlisp as Log-parser
December 13, 2018, 03:51:16 AM
Hello,



After Long time using newlisp I am still impressed about it's speed.

Yesterday I had a Log-File from our Unix-Host with 588000 lines and 35 MB size.

The newlisp code takes about 40 sec to read each line and parse a complex structure out.

The result file was 10000 lines in 46KB.

No highend-PC.



I like it. One of the best Tools in my Toolbox.



Regards

Hans-Peter
#6
Hello,



I could thing about a cmdline option for newlisp to keep it running.

This means I can call the newlisp.exe simply a second time and instead of starting a second instance it passes the cmdline-args to the running instance and call there a predefined function with it.



Sample:


newlisp.exe -k funcname

-k stands for keep running and listen to the cmdline.

The funcname is called on the second call of the exe and gets the cmdline-aruments of the second call passed.



Second or further call:
newlisp.exe param1 param2 ....
would call:
(funcname param1 param2 ....)

The function is either loaded per cmdline on the first call or is placed in init.lsp

The running instance can be terminated as always by executing the (exit) funktion.



What do you think of such native support?

Of cource it would be possible to build such option with a custom exe with newlisp.dll

Benefit would be to hold huge data in memory with one loading and do processing on it with small individual calls. Kind of newlisp-state-mashine.



Or the other way round.

Start a normal instance and use this for the second call:
newlisp.exe -r funcname param1 param2

-r stands for use running instance and call function with params.



Regards
#7
Hello,



I would find it usefull if the doc of the 'read' command could give a advice to command 'seek' (and link) about setting the file-pointer to a different position in the file.



Regards
#8
Hello,



Today I find a bit time to test a new combination: newlisp.dll UTF8 with purebasic 5.62

Since latest purebasic versions are unicode compiler, it was interesting to use newlisp.dll UTF8  there.



Importing the dll is simple:

OpenLibrary(0,"newlisp_utf8.dll")

The call function can look like this:

sourcestr.s = GetGadgetText(#Gadget_Form1_String3)
*newlispstr = AllocateMemory(StringByteLength(sourcestr) + SizeOf(Character))
PokeS(*newlispstr, sourcestr, Len(sourcestr),#PB_UTF8)
retstr.s = PeekS(CallFunction(0,"newlispEvalStr",*newlispstr),-1,#PB_UTF8)
FreeMemory(*newlispstr)
SetGadgetText(#Gadget_Form1_Editor5, retstr)

At the end you can (not needed, but cleaner)

CloseLibrary(0)

Regards
#9
Hello Lutz,



In the 10.6.3 thread was an anouncment about used build tool for newlisp binarys:



http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=2&t=4720&hilit=gcc">http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=2&t=4720&hilit=gcc



So is http://tdm-gcc.tdragon.net/">http://tdm-gcc.tdragon.net/ now the recommended compiler for building newlisp on Windows?



Is tdm-gcc-5.1.0-3.exe the right version?

Or tdm64-gcc-5.1.0-2.exe ?



Regards

Hans-Peter
#10
Hello,



Based on the current newlisp-js version I am making progresses in using it from javaScript-GUI frameworks.



One solution is based on NeoAppBuilder/VisualNeo. Currently still in beta.

Test-app: http://www.hpwsoft.de/nl/">http://www.hpwsoft.de/nl/

The GUI tool uses Bootstrap,Angular and Jquery internaly.



Another solution is based on spiderbasic,

Test-app: http://www.hpwsoft.de/nls/">http://www.hpwsoft.de/nls/

The language embeds various js-libs like jquery,dojo,paperjs and others

http://www.spiderbasic.com">http://www.spiderbasic.com

https://www.spiderbasic.com/showcase/onlineviewer/">https://www.spiderbasic.com/showcase/onlineviewer/



I expect to be able to use newlisp-js in modern web-apps.

Test-reports from other platforms than Windows wellcomed.

Tested on Win with IE11, Chrome 68, Firefox 61

And on Samsung Handy S3 with Chrome



Regards
#11
Hello Lutz,



I had a wish for improving pretty-print.

Idea: I had problems in reading complex, nested lists which were saved with default pretty-print.

The problem is that on the first line are several list-items and on the following line one list per line.

For simple list it is pretty enough to be readable.

When symbols gets longer and more complex lists, I would like to see an option to use open-paranthese as line-seperators. The option could be activated by using a "(" instead of an integer.

Each open-paranthese would increase indent and the corrosponding close paranthese would decrease.

Sample-Call:

(pretty-print "(" " " "%1.16g")

Sample Output:

(set 'Symbolname
'("MainItem"
  ("Item1" "Value1")
  ("Item2" "Value2")
  ("Item3" "Value3")
  ("Item4" "Value4")
  ("Sublst"
   ("SubItem1" "SubValue1")
   ("SubItem1" "SubValue1")
   ("SubItem1" "SubValue1")
   ("SubList"
    (
     ("SubListItem1" "SubListValue1")
     ("SubListItem1" "SubListValue1")
     ("SubListItem1" "SubListValue1")
    )
   )
  )
 )
)


What do think?



Regards
#12
Hello,



I have a long flat list of params parsed from a csv file.

For example it has for eample 49 items and I know that they are a mulitple of 7 elements.



What is the most elegant way to slice the list into a list with 7 sublists with each 7 items?

In a loop with (slice 0 7) and so on?



Regards

Hans-Peter
#13
newLISP in the real world / file-info on directorys
April 27, 2016, 11:16:35 AM
Hello,



Should file-info return the size of a Directory?

The doc is not clear.

And on windows it does not.


(file-info "C:/Temp")

(0 16895 2 0 0 1457865730 1457865730 1309073923)



Regards
#14
newLISP in the real world / inc non-destruktive
April 21, 2016, 01:06:02 AM
Hello,



I noticed that quoting the symbol makes inc non-destruktive


Quote
> (setq Test 1)

1

> (inc 'Test)

2

> Test

1

> (inc Test)

2

> Test

2


Not documented.



Regards
#15
Hello,



I noticed that some of my apps using newlisp.dll throw an error running under win 10.



After getting access to win 10 on my sons laptop I dig into the problem and find the reason:



Doing this pascal-code in my delphi host app does give trouble under win 10:

DllHandle := LoadLibrary( Pchar( 'newlisp.dll' ));


Giving only the dll-name let the system search in the search-hierachy of windows.

This works on all windows before windows 10.

Because of security concerns MS seems to block now this loading.



The workaround/solution here is to give a full path and filename to LoadLibrary.

So I load the dll now from the same directory as the host-exe.



Regards



Hans-Peter
#16
Hello,



Maybe a thing for the future: Would it be possible to use newLISP for win universal apps ?

Since universal apps are based on HTML and javascript, it let me think about using newLISP-js.



Regards
#17
Hello,



Still have no win 10 system, so maybe someone can answer this question:



Does 'newLISP in a browser' run on MS win 10 browser edge?



Maybe of interest:



https://blogs.windows.com/msedgedev/2015/05/07/bringing-asm-js-to-chakra-microsoft-edge/">https://blogs.windows.com/msedgedev/201 ... soft-edge/">https://blogs.windows.com/msedgedev/2015/05/07/bringing-asm-js-to-chakra-microsoft-edge/



Regards
#18
newLISP and the O.S. / java 8 no more on WIN XP
January 25, 2015, 05:13:02 AM
Hello,



Today on my older WIN XP box a java update run and a message pops up that java 8 should run only on a newer OS.

And you could use java 8 only on your own risk on XP.



http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html">http://www.oracle.com/technetwork/java/ ... 57071.html">http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html



Note: First feature is Lambda Expressions!!



Hopefully newLISP will continue to run on the latest java 7.



Regards
#19
Hello,



I used successfully chp to run newlisp.exe jobs with commandline parameter hidden without console window.



http://www.commandline.co.uk/chp/">http://www.commandline.co.uk/chp/



Regards
#20
newLISP in the real world / newlisp-js IDE
January 05, 2014, 02:54:22 AM
Hello Marc,



Possible improvment for your newlisp-js IDE here:



http://newlisp.neocortex.io/">http://newlisp.neocortex.io/



When nothing is selected in the Input area, the Manual button should link to:



http://www.newlisp.org/downloads/manual_frame.html">http://www.newlisp.org/downloads/manual_frame.html



When text is selected (for example println) then call:



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



Then we have context-help.

(Not sure if this is supported by textarea)

Some discussion here:

http://stackoverflow.com/questions/275761/how-to-get-selected-text-from-textbox-control-with-javascript">http://stackoverflow.com/questions/2757 ... javascript">http://stackoverflow.com/questions/275761/how-to-get-selected-text-from-textbox-control-with-javascript



Regards