Search found 1390 matches

by HPW
Sat Nov 29, 2003 8:12 am
Forum: Whither newLISP?
Topic: infix reader macro from clisp to newLisp?
Replies: 19
Views: 16871

With the info about basic operators from the other thread, it make me thinking about infix-reader output. It works for me right now, but I could imagine that other want to parse the formula to integer arithmethic. So this would do that I think: (set 'operators '( ("+" + 2 3) ("-" - 2 3) ("*" * 2 4) ...
by HPW
Sat Nov 29, 2003 8:05 am
Forum: Anything else we might add?
Topic: Automatic integer conversion with basic math operators
Replies: 3
Views: 3667

So now I know that newlisp operators works that way, I only have to keep an eye on it, when porting code to choose the right replacement for the universal operators from the other Lisp. Thanks for the info. Can you explain a bit about embedded systems applications? Could there be a version on Pocket...
by HPW
Sat Nov 29, 2003 7:54 am
Forum: newLISP and the O.S.
Topic: newlisp.DLL possible?
Replies: 105
Views: 127531

No problem!
Have a nice Thanksgiving.
We have the 1.Advent. :-)
by HPW
Fri Nov 28, 2003 7:21 am
Forum: Anything else we might add?
Topic: Automatic integer conversion with basic math operators
Replies: 3
Views: 3667

Automatic integer conversion with basic math operators

I find it not very well documented (and also strange) that the basic math operators are different to other lisps. (+ 1.12 2.13) 3 (integer?(+ 1.12 2.13)) true (add 1.12 2.13) 3.25 In alisp, corman lisp and lispworks they return a float when one operand is a float. I had some unexpected results on po...
by HPW
Thu Nov 27, 2003 1:40 pm
Forum: Whither newLISP?
Topic: infix reader macro from clisp to newLisp?
Replies: 19
Views: 16871

Some operators are missing: (set 'operators '( ("=" set! 2 2) ("+" add 2 3) ("-" sub 2 3) ("*" mul 2 4) ("/" div 2 4) ("^" pow 2 5) ("asin" asin 1 9) ("acos" acos 1 9) ("atan" atan 1 9) ("sin" sin 1 9) ("cos" cos 1 9) ("tan" tan 1 9) ("sqrt" sqrt 1 9) ("^" pow 1 6))) PS: Why is 'pow' 2 times in the ...
by HPW
Thu Nov 27, 2003 1:38 pm
Forum: newLISP in the real world
Topic: How about (read) ?
Replies: 3
Views: 3718

For alisp compatibility I use this: (define (read readstr readret) (cond ((float readstr) (if (find "." readstr) (setq readret (float readstr)) (setq readret (integer readstr)) ) ) ((=(slice readstr 0 1)"(") (setq readret(eval-string(append "'" readstr))) ) (true (setq readret (symbol readstr)) ) ) )
by HPW
Thu Nov 27, 2003 1:31 pm
Forum: newLISP and the O.S.
Topic: newlisp.DLL possible?
Replies: 105
Views: 127531

When you need help with testing, let me know!
Of cource the basic function should be in place.
by HPW
Thu Nov 27, 2003 8:15 am
Forum: newLISP and the O.S.
Topic: newlisp.DLL possible?
Replies: 105
Views: 127531

But I will look into the DLL stuff anyway.
In December 7.4 will be released and the rest of the year I will just concentrate on bugfixes, a more comprehensive test-suite and review of the manual.
Any idea or date when the DLL-feature could get reality?
Only a question, so no pressure!
by HPW
Tue Nov 25, 2003 7:01 am
Forum: Anything else we might add?
Topic: assoc error when list is nil
Replies: 7
Views: 6261

>Does alisp automatically bind new vars to nil?

Yes!

Code: Select all

command: !a
nil
We must accept that in the Lisp-family are some dialekts which differ in details. But there is always (mostly) an easy workaround.
by HPW
Mon Nov 24, 2003 6:55 am
Forum: Anything else we might add?
Topic: assoc error when list is nil
Replies: 7
Views: 6261

>Apologies for misconstruing your point. Nigel, no need for apologies. I want every sort of discussion to learn more and get better on lisp. I had it tested with corman lisp and lispworks. You tested assoc with symbol nil. When you test against a var which is nil, you get: The variable is unbound. >...
by HPW
Sun Nov 23, 2003 10:25 pm
Forum: newLISP in the real world
Topic: Strange function symbol?
Replies: 4
Views: 3882

Code: Select all

(set 'var any-thing)
(symbol? any-thing)     => true
The doc is not that clear.
by HPW
Sun Nov 23, 2003 9:02 pm
Forum: newLISP in the real world
Topic: Strange function symbol?
Replies: 4
Views: 3882

Oops, thanks for the explanation.
by HPW
Sun Nov 23, 2003 6:15 pm
Forum: newLISP in the real world
Topic: Strange function symbol?
Replies: 4
Views: 3882

Strange function symbol?

Code: Select all

newLISP v7.3.8 Copyright (c) 2003 Lutz Mueller. All rights reserved.

> (set (symbol "var") 345)
345
> (symbol? var)
nil
> 
Why does it return nil?
by HPW
Sun Nov 23, 2003 1:09 pm
Forum: Anything else we might add?
Topic: assoc error when list is nil
Replies: 7
Views: 6261

I only want to point out the difference to alisp.
I stuck on it when porting alisp code to newlisp.
Of cource it is not a problem to work around.
by HPW
Sun Nov 23, 2003 8:54 am
Forum: Anything else we might add?
Topic: assoc error when list is nil
Replies: 7
Views: 6261

assoc error when list is nil

assoc gives an error when the assoc-list does not exist (nil). I am not sure what is better: Alisp give back only a nil. CommonLisp gives also an error. So now I have to check first that the list exists. If I would get back nil, I would do this: (if (setq test(assoc value assoc_list)) (setq newvar (...
by HPW
Sat Nov 22, 2003 6:06 pm
Forum: Anything else we might add?
Topic: function for filelist with matching files
Replies: 6
Views: 6117

It seems to be a bug in regex. Only when something in the search pattern is changed, it get a new result set. Only changing the case of a letter does not get it. When you change to another letter, the sensitive flag is processed correctly. (regex "^A.*\.mbi" "A0002.mbi" 0) ("A0002.mbi" 0 9) > (regex...
by HPW
Sat Nov 22, 2003 2:24 pm
Forum: Anything else we might add?
Topic: function for filelist with matching files
Replies: 6
Views: 6117

So this is the way to go: (define (files fpath fpattern caseflag)(filter(fn (x)(regex fpattern x caseflag))(directory fpath))) (files "c:/temp/" "^A.*\.mbi" 0) When started from the tk-console the text-output speed of the console is the limiting factor when output sveral thousand file-names. A more ...
by HPW
Sat Nov 22, 2003 12:22 pm
Forum: Anything else we might add?
Topic: function for filelist with matching files
Replies: 6
Views: 6117

Thanks Nigel,

Nice and short. Have not thought enough about it. :-)
Have to test it with big files-counts.
by HPW
Fri Nov 21, 2003 10:27 pm
Forum: Anything else we might add?
Topic: function for filelist with matching files
Replies: 6
Views: 6117

function for filelist with matching files

The (directory) function gives back all files in a directory.

I would like a function like this:

(files "C:\temp\A*.txt")

which would return all matching text-files in that dir.
by HPW
Fri Nov 21, 2003 9:42 pm
Forum: Anything else we might add?
Topic: doc error in >> function
Replies: 0
Views: 3142

doc error in >> function

Typo in doc in >> function:

(>> 1024 10) => 2

Code: Select all

> (>> 1024 10)
1
by HPW
Fri Nov 21, 2003 6:43 am
Forum: newLISP in the real world
Topic: international support in TK frontend?
Replies: 0
Views: 2909

international support in TK frontend?

The discussion about locale makes me thinking about international support for a/the TK frontend. A start would be the config: set Ide(Lang) "EN" set Ide(Lang) "DE" set Ide(Lang) "FR" set Ide(Lang) "NL" etc. A submenu in the options menu would be the next step Then there is a subfolder in the Bwidget...
by HPW
Thu Nov 20, 2003 7:00 am
Forum: newLISP Graphics & Sound
Topic: Turtle.lsp bug in 7.3.7
Replies: 5
Views: 5799

No it does not work.

No fractal appears, only a red and a blue straight line from top-left to bottom-right (at different screen-position) appears.


So switching the locale is the way to go for now.
by HPW
Thu Nov 20, 2003 6:55 am
Forum: newLISP in the real world
Topic: upper-case/lower-case with umlauts?
Replies: 13
Views: 8565

> (set-locale 0 "C") "C" > (upper-case "asdöäüÖÄÜß") "ASDöäüÖÄÜß" > (set-locale 0xFF "") "LC_MONETARY=German_Germany.850\nLC_TIME=German_Germany.850\nLC_NUMERIC=German_Germany.850\nLC_COLLATE=German_Germany.850\nLC_CTYPE=German_Germany.850\n" > (upper-case "asdöäüÖÄÜß") "ASDÖÄÜÖÄÜß" With locale "C"...
by HPW
Wed Nov 19, 2003 8:54 pm
Forum: newLISP Graphics & Sound
Topic: Turtle.lsp bug in 7.3.7
Replies: 5
Views: 5799

I tried both:

Code: Select all

(set-locale 0)
nil

(set-locale 0x10 "de_DE")
"LC_NUMERIC=German_Germany.850\n"
But when I then try turtle.lsp it stays the same error.
by HPW
Wed Nov 19, 2003 6:06 pm
Forum: newLISP and the O.S.
Topic: solaris compile
Replies: 7
Views: 6896

>unlimited size in Tcl proc:

Really graet! Offers now the same speed as loading from disk-file!
Thanks again!