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 - JohnE

#1
Hello,



I've just tried it:



-------------------------------

newLISP v.10.5.1 32-bit on Win32 IPv4/6 libffi, options: newlisp -h



> (define (D:foo x y) (+ x y))

(lambda (x y) (+ x y))

> (D:foo 3 5)

8

>

-------------------------------



However, if D is already defined as something else, it fails.  I think that's reasonable.

This is what I did after the above test:



------------------

> (delete 'D)

true

> (D:foo 3 5)           <-----------  check if it's gone



ERR: context expected : D         <-----------  Yes, it's gone

>

>

> (set 'D 0)          

0

> D

0

> (define (D:foo x y) (+ x y))



ERR: context expected in function define : D             <----------- D already exists as something else

>

---------------------------------





John
#2
newLISP newS / Not news!
May 25, 2011, 09:38:28 AM
Hello Lutz,



This section is becoming a bit contaminated with non-news, I reckon.  Some moving to do, maybe?



Regards,  John
#3
newLISP newS / Re: newlisp can be compiled ?
May 25, 2011, 09:31:54 AM
Oops, this post is in the wrong section of the Forum.



newLISP scripts cannot be compiled, only executed.   It can be supplied with a script address on the command line, though, which it will load and interpret automatically.  Search the forum for advice on running stand-alone scripts.



Regards,  John
#4
I have only just realised that the temporary symbols such as the x in:

(dolist (x some-list) ... ) are actually persistent and remain to be listed later by (symbols).  If this dolist is in a definition, then subsequently deleting 'x results in the definition failing next time it is used.  If there was an existing x with a value other than nil, then it remains unchanged, as expected, so it isn't obvious that one would otherwise have been created.



> (50 5 (symbols))
(add address amb and append)
> (define (scratch) (dolist (add-it '(x y z)) "done"))
(lambda ()
 (dolist (add-it '(x y z))
  "done"))
> (50 5 (symbols))
(add add-it address amb and)
> (scratch)
"done"
> (delete 'add-it)
true
> (scratch)

ERR: symbol is protected in function dolist : nil
called from user defined function scratch
>


This might be known by all, but it was news to me.  I was idly picking off symbols clutter, some with nil values, then discovered I had ruined several definitions.   I have been keeping snapshots using (save) so it was easily repaired.   (It is because of the snapshots that I was clearing the redundant symbols, to speed up save and load.  It is so easy to switch between several independent projects using save & load.)



Since I can't remember what might actually be used in a definition somewhere, I shall leave them all alone from now on.   Maybe I should just settle on one name for this 'tempory' symbol, and always use that.  'Temp' might be a good name!



Regards, John



(Edited to add code)
#5
Anything else we might add? / Colon hic
February 16, 2009, 09:29:09 AM
Thanks Lutz, much obliged.  I knew it was me (so I got that bit right).

A lesson soundly learned.



Regards,  John
#6
Me again already.



If test.lsp is reduced to:



(set 'infile (open (main-args 2) "r"))

(close infile)



Then I still get the result:



ERR: symbol expected : "a_label:"



And back into the command line.



Seems like newLISP is reading the contents of the file without being asked. :(



I know it must be me, it always is.  I've missed something.  



Regards, John
#7
What am I doing wrong here?   I saved this very short program as 'test.lsp':



(set 'infile (open (main-args 2) "r"))

(print (read-line infile) "n")

(close infile)



It is in a directory with this very short file called 'test.txt':

a_label:



If I run this on the Windows console command line:

newlisp test.lsp test.txt



I get:

a_label:



ERR: symbol expected : "a_label:"



and am back in the command console.



If I change test.txt to:

a_label



It opens the file, prints 'a_label', and leaves me in newlisp, where I should be.



What is that colon doing?



John

(Oops, edited, because in the original posting I left out the 'a_label:' which atually gets printed)
#8
Anything else we might add? /
February 26, 2008, 07:24:28 AM
Yes, only this week, after updating Opera.  But I just changed to subSilver style - OK.  Changed back to Avalanche - OK too.



So I'll mumble 'emergent behaviour', tyr to look profound and walk slowly away...



John
#9
Is it me?  Quite a lot of messages are very difficult to read.  There seems to be no line wrapping,  making the page very wide sometimes.  Is there some forum setting I should adjust?  I am using Opera (9.26) on Win2000sp4, in case that matters.



John
#10
Anything else we might add? /
November 15, 2007, 08:27:51 AM
newLisp: no batteries required



newLisp: quick thinking





John
#11
newLISP Graphics & Sound /
November 05, 2007, 02:37:10 AM
Thanks for the attention, Lutz.  Everything in the newLISP files was already as you expected.  Changing the guiserver.lsp jar invocation line from this:



(set 'server-path (string  """ (env "PROGRAMFILES") "/newlisp/guiserver.jar""))



to this:

(set 'server-path (string "javaw.exe -jar " """ (env "PROGRAMFILES") "/newlisp/guiserver.jar""))



did the trick.



The .jar association in Windows had got nobbled, probably by some archiver installer with an agressive approach!  (Which explains why all three machines refused to behave.)



Updating Java obviously left it broken.   Using the Win  'Folder Options'  to reconnect with javaw.exe merely set '.jar' to run 'javaw.exe %1'.  There is no way to add the -jar switch using 'Folder Options'.



So finally I twigged, and found an orphan 'jarfile' redirection in the registry.  Made a new .jar entry referring to this, made jarfile/shell/open/command into javaw.exe -jar etc, and away I went!



Thanks for your responses,  apologies for using your time.



Regards,  John



P.S.  I'm using newLISP v.9.2.4/newLISP-GS v1.05
#12
newLISP Graphics & Sound /
November 03, 2007, 10:52:25 AM
Well, I spoke too soon :(



Got the right javaw.exe, and the GUI runs fine, but trying any demo file fails with Java not finding 'main'.



newlisp outputs this:

> (lambda (gs:id gs:action) (net-send gs:out (string "frame-closed "

   gs:id " " gs:action "n")))



I'll keep poking about, but if it is something obvious, please let me know.

I will tell you if I find out first.



Regards,  John
#13
newLISP Graphics & Sound /
November 02, 2007, 11:21:14 AM
Thanks for the reply Lutz.



The links were already in fact correct, and the laptop used C: anyhow.



This worked:

F:WINNTsystem32javaw.exe -jar "F:Program Filesnewlispguiserver.jar" 47011 newlisp-edit.lsp /local/newLISP128.png



from the icon but not the Run box or dosbox.



Turned out that the Windows association was with javaw.exe in the Prog..Java directory.  Changed it to  F:WINNTsystem32javaw.exe, and icon launches perfectly without the full java path.  I didn't even know the java filers were in WINNTsystem32!   Howzat? We live and learn.



The command line failed because it was not in the newLISP directory...



So it's OK now!  Now bracket-matching practice begins.  It's an impressive work you have produced.



John






Quote from: "Lutz"The problems may come from the fact that you installed on F:. Try to start newLISP GS this way:



"f:Program Filesnewlispguiserver.jar" 47011 "f:Program Filesnewlispnewlisp-edit.lsp"



You could also try to fix the link on the desktop, it also specifies an additional argument, which is a splash screen for the startup, but you can also start without it. This additional argument is: /local/newLISP128.png . The path refers to the inside of guiserver.jar, don't change it.



I also recommend to install the latest development version 9.2.4, which has a much improved newLISP GS part compared to the release 9.2.0.



Welcome yo newLISP, let us know if this helps to run newLISP GS



Lutz





ps: if you feel that Java 1.6 is too big for your machine, newLISP GS runs also fine on Java 1.5
#14
I'm a newcomer to newLISP, but you seem a friendly bunch so I feel brave enough to ask this:



I installed newLISP without fiddling with any of the standard instalation.  newLISP.exe itself runs just fine,  but newLISP-GS, launched from the icon or a command line  just gets a complaint from Java that it cannot find the main function.  I've checked in the guiserver.jar manifest, it correctly identifies the guiserver class.



I had J1.5, updated to 6 (not fun on a dialup with 8km of line), still no joy.  newLISP-GS will not run on my number 2 PC either (w2000, J1.5) or my laptop (W98SE, J1.4).



ImageJ runs just fine (but that is an exe, not a jar).



%PROGRAMFILE% shows "F:Program Files", which is correct, so guiserver.lsp is being fed the right thing.



Any idea's?



Regards,  John