Version 9.1.6 contains only minor fixes and adjustments, no binary installers are available with this development release.
v.9.1.7, due around the end of May will contain the new GUI modules and come with binary installers.
http://newlisp.org/downloads/development/
Lutz
I got few ideas for improvement:
1) rest with optional number of elements to remove
(rest lst 2) = (rest (rest lst))
2) apply with negative 'int-reduce' - similar to fold right
http://newlisp-on-noodles.org/wiki/index.php/Functional_Programming#Reducing_lists_-_folds
(apply op '(1 2 3 4 5) 2) = (op (op (op (op 1 2) 3) 4) 5)
(apply op '(1 2 3 4 5) -2) = (op 1 (op 2 (op 3 (op 4 5))))
3) (++ x) (-- x)
Very common +1 and -1 (for better readability).
4) destructive append
- similar to 'write-buffer', but for lists
(not sure about the name for this function)
5) function 'round' has 'int-digits' optional - currently not documented
> (round 123.49 0)
123
> (round 123.49)
123
Fanda
Quote
4) destructive append
- similar to 'write-buffer', but for lists
(not sure about the name for this function)
Heh... and, probably, a way to push a list in the middle of the list :-)
(set 'lst (append (0 n lst) (lst-pushed) (n (length lst) lst)))
Add this to the list too:
1. Enhance the NOT function so that if it has multiple arguments it evals all of them so that you can write (not (= a 2)) as (not = a 2). This will get rid of a pair of parentheses almost every time.
2. Allow a negative integer in EXPLODE so that we break from the end rather than the beginning.
(explode "NewLISP" 2) -> ("Ne" "wL" "IS" "P")
(explode "NewLISP" -2) -> ("N" "ew" "LI" "SP")
Quote
Enhance the NOT function so that if it has multiple arguments it evals all of them so that you can write (not (= a 2)) as (not = a 2).
I do not get this.
(eval =) only returns the symbol adress. (eval a) returns nil.
(eval 2) returns itself.
So you want a (not(and(eval =)(eval a)(eval 2))) ?
Maybe your way is is less typing, but not easy to read and understandable at the first look. Also when the logik gets more complex with nested expressions it seems not real lispy.
I'm sorry that I explained myself badly. Perhaps I'll do so again but I will retry. What I had in mind was that with multiple arguments the first one should be a boolean function name and the rest of the arguments should be the arguments to that function. The idea was that for simple logic expressions like the one I gave that one can throw out the parentheses. Obviously you are not required to do so if you don't want to. As for "unlispy" I can't judge that because I thought LISP was all about finding simplifications of expressions.
For your information, 9.1.6 still compiles and runs without errors and without problems on Tru64Unix.
Cheers
Peter
Quote from: "Fanda"
1) rest with optional number of elements to remove
(rest lst 2) = (rest (rest lst))
It might not be necessary to redo 'rest'. N-rest can be done using 'slice' and implicit rest.
> (set 'lst '(1 2 3 4 5))
(1 2 3 4 5)
> (rest lst)
(2 3 4 5)
> (rest (rest lst))
(3 4 5)
> (2 lst)
(3 4 5)
> (slice lst 2)
(3 4 5)
Fanda
Quote from: "Lutz"
v.9.1.7, due around the end of May will contain the new GUI modules and come with binary installers.
...The beer just hit the fridge... Im ready.. ;-)
newLISP development version 9.1.7
Not the GUI version yet but some bug fixes I wanted to get out:
http://newlisp.org/download/development/
You can see a preview of what is coming next week here:
http://newlisp.org/download/development/guiserver-development.png
The new GUI console app is entirely done using the new GUI facilities. The beautiful icons are created (*) by Michael Michaels from http://neglook.com
Lutz
(*) this is work in progress, not licensed for usage/distribution yet
The beer has to wait a few days.
Still curious what the communication technic between newLISP and the GUI-Server will be?
2 processes communicating?
1 process with a GUI-Lib?
And of cource curious on the list of the supported GUI-elements.
The preview shows us:
gs:frame
gs:button
gs:panel
Tabbed pane?
gs:set-flow-layout seems also very interesting!
So what is used for the GUI-Server and has this project its own documentation?
Aaaa now im realy lost... Cant make up 100% what the widgets are
made of ... Ill double the beer in the fridge ;-)
Btw: thanks for the fix Lutz!
I wonder nobody has figured it out so far :-)
several of the terms used in the API gave it away ;-)
Quote
2 processes communicating?
yes, thats where the name server comes from. The server process links to a popular platform independent libray which comes preinstalled on Win32 and Mac OSX. On UBUNTU it also has been announced for 7.04, but not all kinks are worked out yet (have only been able to experiment with the life disk).
Quote
...and has this project its own documentation?
yes, that library used does have its own documentation, but that documentation (which is rather huge) is not necessary to study when building newLISP GUI apps. The newLISP GUI API is a high-level abstraction of the original API. I am working on the newLISP documentation right now, and only that documentation will be required.
Quote
Tabbed pane?
yes, it supports tabbed panes as the icon demo shows and also split-panes and scroll-panes. A split-pane is used in the console app to the left. You can drag the bar between the 2 windows up or down.
Lutz
Quote from: "Lutz"
newLISP development version 9.1.7
You can see a preview of what is coming next week here:
http://newlisp.org/download/development/guiserver-development.png
Ah yes, and it looks soooo good on the Mac! (No offense to other platforms.) :-)
Quote
No offense to other platforms
We have not seen the other platforms yet!
;-)
So wait and see.
Looks good!
I'll start brewing the coffee...
I realy cant figure it out..
What GUI run default on Windows and Mac and Ubuntu?? Beats me ;-)
Other Unices needs perhpas extra addons...? I realy dont know what that is...
Mmmmmm no the example names dont ring any bell yet....
I do know a lot of widget/GUI's but none of those fit in the above...
Ill start drinking..perhpas that lightens the mind ;-)
I think the GUI picture killed newlisp.org ...too popular ;-)
Is it MONO & .NET ?
Or perhpas a JavaScript / Mozilla Gui Engine extention we dont know of yet ;-)
its JAVA ! (GlassFish)
coffee's brewed... :-)
Ptooie! (Hollywood spit take)
What?!!
But it cant be JAVA..because JAVA is not default on Win32..
..It isnt default on any system...
So I give up!.. I realy dont know what Lutz is using...
Quote
But it cant be JAVA..because JAVA is not default on Win32..
..It isnt default on any system...
Not true, Java comes preinstalled on Mac OSX and installed on every Win32 computer I have tried (e.g. Dell machines out of the box). Guiserver just needs the Standard Java RE (runtime environment) as also used by browsers as MS IE and FireFox. Here some more facts about Java and the guiserver:
- standard installed/shipped on Win32 and MacOS X and UBUNTU since 7.04
- full featured, mature, open source (SUN is GPLing it)
- well supported by a large community
- guiserver is built on swing libs
- can switch look-and-feel between platform native, swing-metal and motif, guiserver by default shows platform native look and feel.
- good execution speed on a 2 year old PPC Mac/1.42GHz, very fast on the new Intel Macs, very fast on a 3 1/2 year old 1.8GHz XP-Home machine.
- startup speed on a fresh booted PPC is the first time 10+ seconds but all startups after that only about 2 seconds. On an Intel Win32 or Mac OSX machine 1.8GHz machine startup the first time about 7 seconds, but after that about 1 second or less.
- initially guiserver only supports GUI stuff, 2D graphics are added during June. A feature complete newLISP console for stable release 9.2 in August.
- The Tcl-tk stuff will be discontinued but example files show how to write Tcl/Tk apps (using Fanda's runtk, which is also featured here: http://newlisp.org/index.cgi?page=Tk_and_newLISP
Lutz
I must say that JAVA is a good choise if you want to be Multi OS based with a
solid well tested GUI.. Its even working on Mobile Phones , Tv's and my
microwave ;-)
JAVA has lots and lots of possibilty's !! including a newlisp GUI, and by making
that step newlisp will become a harder competitor for other languages.
On the other hand... I was never found of JAVA because i lack the way of thinking...
And i think with the guiserver we dont even have to go that way anyway...
I realy dislike the VM memory megabyte kill of JAVA..(eats too much memory 50MB+)
But on the otherhand I always loved the flexibilty of JAVA's GUI..
That brings me right to http://www.processing.org where newlisp will now
push that right off the edge !!!
So.. I now truly need to brush my teeth because the word JAVA did not
pass my mouth that often as today..I also need to Reinstall on every system I
own JAVA..(because its the first thing I remove when I find it..;-)
man..after rethinking this choise... I must say.. Good one!
Lets kick some tools into the world and push some languages to the bin-basket ;-)
Norman.
Quote
- guiserver is built on swing libs
Interesting news!
So we can use/learn swing related resources.
http://java.sun.com/docs/books/tutorial/uiswing/
Will it be possible/make sense to use one of the available swing-GUI builders?
(Converting GUI-definitions to newLISP GUI-server-syntax)
Any plans to add a 3D API later?
http://java.sun.com/products/java-media/3D/
https://java3d.dev.java.net/
(Natural question from a CAD-LISP-Programmer)
;-)
Quote
So we can use/learn swing related resources.
No, no.
The newLISP API is very different, much smaller and in part terminology has changed too. Lerning anything Java or Swing won't help you. The Java style of programming is also completely different.
The module documentation coming with guiserver and the examples are enough to get you started.
Lutz
ps: in the near/middle future no plans for a 3D API only standard Java RE stuff. I don't think the 3D media libraries are part of this.
Quote
The module documentation coming with guiserver and the examples are enough to get you started.
Getting more and more curious on the release!
Quote
ps: in the near/middle future no plans for a 3D API only standard Java RE stuff. I don't think the 3D media libraries are part of this.
Would it be possible after a seperate install of the 3D media libraries with an extended version of the GUI-server?
Quote
... extended version of the GUI-server
Maybe a different approach would even better.
A API to let the GUI-server load java extension libraries (like the 3D media libraries) at runtime and a technic to call this libs without providing a complete lisp-wrapper in the GUI server. (like the import feature in newLISP) So no need to modify the server for each etxetsnion and it can be smaller with the core functions.
Edit: In newLISP-TK there was the possibility to use everything what TCL offers in a easy way. So it was possible to use the best things from both enviroments (newLISP and TCL/TK). So it would be nice to have the best from Java and newLISP.
Quote from: "Fanda"
2) apply with negative 'int-reduce' - similar to fold right
http://newlisp-on-noodles.org/wiki/index.php/Functional_Programming#Reducing_lists_-_folds
(apply op '(1 2 3 4 5) 2) = (op (op (op (op 1 2) 3) 4) 5)
(apply op '(1 2 3 4 5) -2) = (op 1 (op 2 (op 3 (op 4 5))))
I still keep thinking about this and I am canceling my suggestion. Instead of using an 'apply' for folding, I would create a new 'fold':
(define (fold f lst n)
(let (result nil)
(if
(and (>= n -1) (less-or-equal n 1))
(throw-error "n cannot be -1, 0 or 1!")
(> n 0)
(begin
(set 'result (apply f (0 n lst)))
(dotimes (i n) (pop lst))
(while lst
(set 'result (apply f (append (list result) (0 (- n 1) lst))))
(dotimes (i (- n 1)) (pop lst))))
(less-than n 0)
(begin
(set 'n (- n))
(set 'result (apply f ((- (length lst) n) lst)))
(dotimes (i n) (pop lst -1))
(while lst
(set 'result (apply f (append ((- (length lst) (- n 1)) lst) (list result))))
(dotimes (i (- n 1)) (pop lst -1)))))
result))
(Substitute less-than and less-or-equal for appropriate signs - they translate in the post.)
Examples:
> (fold + '(1 2 3 4 5) 2)
15
> (fold + '(1 2 3 4 5) -2)
15
> (fold - '(1 2 3 4 5) 2)
-13
> (fold - '(1 2 3 4 5) -2)
3
> (fold (fn (x y) (list '- x y)) '(1 2 3 4 5) 2)
(- (- (- (- 1 2) 3) 4) 5)
> (fold (fn (x y) (list '- x y)) '(1 2 3 4 5) -2)
(- 1 (- 2 (- 3 (- 4 5))))
; general function f
> (fold (fn () (append '(f) (args))) '(1 2 3 4 5 6 7 8 9) 2)
(f (f (f (f (f (f (f (f 1 2) 3) 4) 5) 6) 7) 8) 9)
> (fold (fn () (append '(f) (args))) '(1 2 3 4 5 6 7 8 9) 3)
(f (f (f (f 1 2 3) 4 5) 6 7) 8 9)
> (fold (fn () (append '(f) (args))) '(1 2 3 4 5 6 7 8 9) 4)
(f (f (f 1 2 3 4) 5 6 7) 8 9)
> (fold (fn () (append '(f) (args))) '(1 2 3 4 5 6 7 8 9) -2)
(f 1 (f 2 (f 3 (f 4 (f 5 (f 6 (f 7 (f 8 9))))))))
There is no hurry to do this. I am just posting it, so that I can stop thinking about it ;-)
Fanda
Love the new fold! Good job, Fanda! --Rick