development version newLISP 8.6.7

Notices and updates
Locked
Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

development version newLISP 8.6.7

Post by Lutz »

This is a preview for the release version 8.7.0 due beginning October.

For release notes and files see here http://newlisp.org/downloads/development/

Lutz

nigelbrown
Posts: 429
Joined: Tue Nov 11, 2003 2:11 am
Location: Brisbane, Australia

Post by nigelbrown »

Thanks Lutz,
I like the distributed computing idea but the release notes for it don't have a description of net-eval mentioned in the preamble?

Nigel

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Oops! thanks, corrected version here: http://newlisp.org/downloads/developmen ... Notes.html

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Maybe you should also tell more about the added space to every return value of newLISP.exe/dll. You only mentioned it with '[cmd][/cmd]'.
Hans-Peter

Fanda
Posts: 253
Joined: Tue Aug 02, 2005 6:40 am
Contact:

Post by Fanda »

There are also some typos:

The two new floating point fiunctions: erf, and sgn where added
=> functions | were

difference intersect -- An optinal parameter true puts these function into
=> optional | functions

gmp.lsp -- high precision arithmetik
=> arithmetic

error-event -- not only functions valled in interactive mode
=> called

[cmd][/cmd] -- This change was necessary for the new net-eval functional.
=> for the new net-eval to be functional
or: because of the new net-eval function

load -- Load now also returns the value of the last expression evaliuated and not just true. This cause also a change in the file init.lsp when trying to load $HOME/.init.lsp.
=> evaluated | caused (?)

erf -- calculates the error funtion
=> function

sgn -- This new fuction
=> function

I put (?) at places where I wasn't sure.

Fanda

ps: www.newlisp.org still has a Tcl/Tk Graphical Fontend
=> Frontend

ps2: I think, I am just a perfectionist:
http://www.learningplaceonline.com/chan ... -intro.htm
http://mentalhelp.net/psyhelp/chap6/chap6p.htm
http://narcissism.homestead.com/nptype.html
http://www.google.com/ -> search for "perfectionist"

Fanda
Posts: 253
Joined: Tue Aug 02, 2005 6:40 am
Contact:

Post by Fanda »

Also:
1) Function 'test-randomize' is in the qa_dot, but isn't in the qa_comma.
-> I would try to find every test-xxx in both files, do unique & sort and compare both lists...

2) Try this code:

Code: Select all

(define (write-my-file lst)
  (set 'out-file (open "data.txt" "write"))
  (dolist (l lst)
    (write-line (string l) out-file))
  (close out-file))

(dotimes (c 20)
  (setq r '())
  (dotimes (x 1000000)
    (push (time (randomize (sequence 1 2))) r))

  (setq s (unique r))
  (println s)
  ;(if (!= 0 (length (filter (lambda (x) (< x 0)) s)))
  ;  (begin
  ;    (write-my-file r)
  ;    (throw)))
)

(println "-----------")
The strangest result I got:
> (0 16 15 31)
(0 16 15)
(0 16 15 47)
(0 16 15 1000)
(0 16 15 -984)
(0 16 15)
(0 16 15)
(0 16 15 1000)
(0 16 15)
(0 15 16)
(0 16 15 1000)
(0 16 15 -984)
(0 15 16)
(0 16 15 -984)
(0 31 15 16)
(0 16 15)
(0 15 16)
(0 16 15)
(0 16 15)
(0 16 15)
-----------

Function (time (randomize (sequence 1 2))) should return 0 (or little over 0) - and in the most cases does - but sometimes it returns -984.

I feel responsible for the idea of running randomize in the loop, so I wanted to try, if there really is a problem with looping for the longer time...

I also tried:

Code: Select all

(dotimes (x 10)
  (println (time (dotimes (y 1000000) (randomize (sequence 1 2))))))
First version should be 0, second version returns sum ("average") of all executions. I am not sure, if the version one proves that 'randomize' sometimes runs several times (I mean "long time").

Fanda

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

yes, 'randomize' repeats when the output sequence is equal to the input sequence, for that reason sometimes the process takes longer, specially with short sequences where the probability of generating an output equal to the input is higher.

Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

There seems to be an issue on Win32 that the 'tv_usec' value in the 'C' 'tm' structure does not get updated in time when 'tm_sec' wraps and the timing is less then Win32 timer resolution of 16 milli seconds.

Running your program on a Mac OSX 10.4.2 does not show this problem:

Code: Select all

(0 1 2 4)
(0 1 2 101 3 99 49 37 5 15 8 6 11 7 9 12 4)
(0 1 2 4 3 16 12)
(0 1 2 15 91 5 8 6 35 124 17 3 7 12 13 16 4 21 24 43 9 10 11 56)
(0 1 49 2 9 8 3 4 6 10 12 15 18 7 14 34 61 16 28)
(0 1 3 2 32 12 48)
(0 1 48 2 5 19 29 10 13 23 14 15)
(0 1 2 48 3)
(0 1 3 29 10 48)
(0 1 12 8 11 9 49 13 14 3 4 6 17 2 5 10 7 75 18)
(0 1 3 48 2 18 4 6 46 8 10 47 71 38 19 94 7 5 26 51 23 15)
(0 1 15 14 2 13 3 5 48 4 23 10 16)
(0 1 2 20 49 4 3 16 21)
(0 1 3 47 48 2 14)
(0 1 2 3 5 6 10 51 9)
(0 1 10 158 2 28 12 5 48 9)
(0 1 48 5 2 10 6)
(0 1 2 10 5 9 47 48 6)
(0 1 47 2)
(0 1 3 20 2 48 14 16 4 13)
What version of Windows are you running?

Lutz

Fanda
Posts: 253
Joined: Tue Aug 02, 2005 6:40 am
Contact:

Post by Fanda »

Nice result - that's what I was looking for.
I am running Windows XP Home Edition (Version 5.1, Service Pack 2).

Some suggestions (it's up to you):
- Would you mind putting some note in the manual how 'randomize' scales in time? ... Just so that people are not surprised why does it sometimes run so randomly?
- I use Microsoft Word to check my spelling. OpenOffice can do the same. You could write the manual there and copy & paste it somewhere else.

Fanda

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

I will mention the time variation of 'randomize' in the manual.

I am writing the manual always with a text editor and a limited fixed set of HTML tags. Only this way I can guarantee clean, tight HTML suitable for processing by help systems extracting info from the manual.

For each official release the file is pasted into OpenOffice for PDF conversion. But a full spellchecking is rarely performed because of the long time it takes, i.e. it will trip over examples and many other strings in the text.

Unfortunately my native language is not English. If you see spelling errors or bad English wording or bad grammatik please post corrections/improvements in the news forum.

Two other people did a complete pass through the manual about a year ago. But the manual is constantly changing.

Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Thanks to Fanda for all the release notes corrections. A corrected version here: http://newlisp.org/downloads/developmen ... Notes.html

Lutz

Jeremy Dunn
Posts: 95
Joined: Wed Oct 13, 2004 8:02 pm
Location: Bellingham WA

Post by Jeremy Dunn »

Suggest an extension to the SGN function:

(sgn x) is (sgn x) but (sgn x A B C) is equivalent to
(if (< x 0) A (= x 0) B C). In other words have the function double as a triconditional.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

I like the idea, look for it in 8.7.0

Lutz

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

Hi Lutz,

Just compiled 8.6.7 on Tru64Unix 4.0f, it runs perfectly without any modifications:
peter> make tru64
make -f makefile_tru64
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET newlisp.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-symbol.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-math.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-list.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-liststr.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-string.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-filesys.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-sock.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-import.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-xml.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-web.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-matrix.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET nl-debug.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET tru64.c
cc -ieee -xtaso -pedantic -c -O2 -DSOLARIS -DTRU64 -D_POSIX_PII_SOCKET pcre.c
cc newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o tru64.o pcre.o -taso -lm -lrt -ldb -lbsd -Lffi-tru64-4.0 -lffi -o newlisp
strip newlisp
peter> ./newlisp qa_dot

Testing built-in functions ...

! != $ % &
* + - / <
<< <= = > >=
>> NaN? ^ abs acos
add address amb and append
apply args array array-list array?
asin assoc atan atan2 atom?
base64-dec base64-enc begin beta betai
binomial case catch ceil change-dir
char chop close command-line cond
cons constant context context? copy-file
cos count cpymem crc32 crit-chi2
crit-z current-line date date-value debug
dec def-new define define-macro delete
delete-file device difference directory directory?
div do-until do-while dolist dotimes
dotree dump dup empty? encrypt
ends-with env erf error-event error-number
error-text eval eval-string exec exit
exp expand explode factor fft
file-info file? filter find first
flat float float? floor flt
for fork format fv gammai
gammaln get-char get-float get-int get-integer
get-string get-url global if ifft
import inc index int integer
integer? intersect invert irr join
lambda? last legal? length let
letn list list? load log
lookup lower-case macro? main-args make-dir
map match max member min
mod mul multiply name net-accept
net-close net-connect net-error net-eval net-listen
net-local net-lookup net-peek net-peer net-receive
net-receive-from net-receive-udp net-select net-send net-send-to
net-send-udp net-service net-sessions new nil?
normal not now nper npv
nth nth-set open or pack
parse peek pipe pmt pop
post-url pow pretty-print primitive? print
println prob-chi2 prob-z process push
put-url pv quote quote? rand
random randomize read-buffer read-char read-file
read-key read-line ref
regex remove-dir rename-file replace replace-assoc
reset rest reverse rotate save
search seed seek select semaphore
sequence series set set! set-locale
set-nth setq sgn share signal
silent sin sleep --- sleep duration: 1000 ---
slice sort
source sqrt starts-with string string?
sub swap sym symbol symbol?
symbols sys-error sys-info tan throw
throw-error time time-of-day timer title-case
trace trace-highlight transpose trim true?
unique unless unpack until upper-case
wait-pid while write-buffer write-char write-file
write-line xml-error xml-parse xml-type-tags |
~

Testing contexts as objects and scoping rules ...


ALL FUNCTIONS FINISHED SUCCESSFULL

newLISP v.8.6.7 on Tru64Unix, execute 'newlisp -h' for more info.

> ring...

Great job.

Cheers
Peter

Locked