Search found 7 matches

by maq
Mon Apr 21, 2008 5:42 pm
Forum: newLISP newS
Topic: char bug?
Replies: 9
Views: 8143

The new behavior in 9.3.0 occurred after introducing error reporting for out of range indices on strings. I looked on the 9.3 release notes and did not see anything related to this, or the similar new behavior on lists. Could you please direct me to an explanation of the new behavior. This change i...
by maq
Fri Apr 18, 2008 10:56 pm
Forum: newLISP newS
Topic: char bug?
Replies: 9
Views: 8143

char bug?

On version 9.3, I get the following: newLISP v.9.3.0 on OSX UTF-8, execute 'newlisp -h' for more info. > (char "") string index out of bounds in function char > Prior to 9.3, this used to return 0. Shouldn't this be still the case being that an empty string by definition (at least in C, which I thou...
by maq
Sat Sep 30, 2006 11:00 pm
Forum: Anything else we might add?
Topic: bit operation example from K+R vs. newlisp
Replies: 1
Views: 2167

bit operation example from K+R vs. newlisp

I was perusing through K+R "The C Programming Language" and came across this tidbit on bit operations: http://www.angrypacket.com/~maq/getbits.png And the (p + 1 - n) doesn't make sense, as it would seem you actually want to do (p - n). I wrote the same function in newlisp both ways: (p - n): http:/...
by maq
Thu Aug 04, 2005 5:19 pm
Forum: Anything else we might add?
Topic: Escaping backslashes in append operation for use in regex
Replies: 2
Views: 3655

Thanks Sammo. That does the trick.

--maq
by maq
Thu Aug 04, 2005 3:52 pm
Forum: Anything else we might add?
Topic: Escaping backslashes in append operation for use in regex
Replies: 2
Views: 3655

Escaping backslashes in append operation for use in regex

I have a small issue getting a regex to work the way I want it to. I set a string to the following: (set 'command-line "woot -r 45 -w 46") And then I want to alternate through the command line options by comparing against a list of flags that I'm looking for. Say: (set 'opts '("r" "w")) So I want to...
by maq
Tue Jan 18, 2005 7:03 am
Forum: Anything else we might add?
Topic: get-string question
Replies: 4
Views: 5585

Thanks for the prompt reply. However, a read-buffer does not fix it. With: (set 'in (open "foo2.png" "read")) ;;(set 'ifile (read-file "foo2.png")) (read-buffer in 'ifile 100) (close in) (println "length of ifile " (length ifile)) (println "length through a get-string " (length (get-string (address ...
by maq
Tue Jan 18, 2005 6:28 am
Forum: Anything else we might add?
Topic: get-string question
Replies: 4
Views: 5585

get-string question

Why is it that I get different values from the following two length calls: (set 'ifile (read-file "foo2.png")) (println "length of ifile " (length ifile)) (println "length through a get-string " (length (get-string (address ifile)))) (exit) --OUTPUT-- maq:maq $ ./test.lsp length of ifile 90 length t...