Search found 13 matches

by hs
Tue Nov 03, 2009 10:47 am
Forum: newLISP and the O.S.
Topic: unbounded memory consumption in unclosed [text]
Replies: 3
Views: 2858

Re: unbounded memory consumption in unclosed [text]

$ more test.lsp (println [text] x) $ date Tue Nov 3 17:31:28 WIT 2009 $ newlisp test.lsp ERR: not enough memory $ date Tue Nov 3 17:35:17 WIT 2009 $ uname -rs OpenBSD 4.6 $ dmesg | grep mem real mem = 1610117120 (1535MB) avail mem = 1547059200 (1475MB) it's weird, i got different result ... i'm on o...
by hs
Mon Nov 02, 2009 7:10 am
Forum: newLISP and the O.S.
Topic: unbounded memory consumption in unclosed [text]
Replies: 3
Views: 2858

unbounded memory consumption in unclosed [text]

> (println [text]x) ~ ERR: missing end of text [/text] ok in cli, however, not in .lsp file, try this (println [text] x) or even this (forgot to type '/' in closing [/text]) (println [text] x[text]) using (string) or (format doesn't help either (println (string [text] x)) (println (format [text] x))...
by hs
Sat Oct 03, 2009 3:05 am
Forum: newLISP in the real world
Topic: suppresing zero in date with # doesn't work in openbsd
Replies: 2
Views: 1217

suppresing zero in date with # doesn't work in openbsd

> (date (date-value) 0 "%a %#d %b %Y")
"Sat #d Oct 2009"
> (date (date-value) 0 "%a %-d %b %Y")
"Sat -d Oct 2009"
> (date (date-value) 0 "%A %-d. %B %Y")
"Saturday -d. October 2009"

newlisp 10.1.5 on OpenBSD 4.5
by hs
Mon May 18, 2009 12:32 am
Forum: newLISP newS
Topic: (replace nil list-of-nil) hangs
Replies: 1
Views: 2462

(replace nil list-of-nil) hangs

> (set 'a '( 1 2))
(1 2)
> (replace 1 a)
(2)
> a
(2)
> (replace 2 a)
()
> a
()
> (set 'a '(true true))
(true true)
> (replace true a)
()
> (set 'a '(nil nil))
(nil nil)
> (replace nil a) ;hangs
by hs
Tue Mar 24, 2009 3:58 pm
Forum: newLISP newS
Topic: unique and sort misbehave given list containing nil
Replies: 1
Views: 2349

unique and sort misbehave given list containing nil

newLISP v.10.0.2 on Linux IPv4 UTF-8, execute 'newlisp -h' for more info. > (set 'q '("m4" "08" nil "rs" "vr" "vt" "m4")) ("m4" "08" nil "rs" "vr" "vt" "m4") > (unique q) ("m4" "08" nil "rs" "vr" "vt" "m4") ;note "m4" appears twice > (sort q) ("08" "m4" nil "m4" "rs" "vr" "vt") ;note "m4" nil "m4" >...
by hs
Sun Jul 20, 2008 5:33 pm
Forum: newLISP newS
Topic: newlisp: SMS CDMA
Replies: 0
Views: 2355

newlisp: SMS CDMA

I'd like to share my brief experiment with CDMA venus VT-21 modem (TIAN TUO XIN DIAN CDMA Technologies) for sending SMS the modem works under windows (98/xp tested) and linux (unreliable driver tho) ;COM4 from system property or /dev/ttyACM0 from dmesg (set 'o (open "COM4" "update")) ;sending sms to...
by hs
Wed Mar 05, 2008 7:22 pm
Forum: newLISP newS
Topic: list index out of bounds
Replies: 9
Views: 3941

oh yeah i forgot to mention that i have to adjust the time to my local time say from 17:00 to 19:02 ... so i have to get 2 values either select or slicing returns a list, not an element (0 1 (parse t ":")) ;gives '("17") (1 1 (parse t ":")) ;gives '("00") so eventually i will need to use (set 'hr ((...
by hs
Wed Mar 05, 2008 2:45 pm
Forum: newLISP newS
Topic: list index out of bounds
Replies: 9
Views: 3941

i'll have to dig the error event, thx my recent case is that i have a newlisp program in remote server to get info about time from some website, write the time to a file to be served via ajax after regex, the time string t can be say "17:00". "17", or "" (set 'T (parse t ":")) ;;;T can be ("17" "00"...
by hs
Wed Mar 05, 2008 1:43 pm
Forum: newLISP newS
Topic: list index out of bounds
Replies: 9
Views: 3941

yes, i do notice my code is less sloppier than it used to be but now it consists of batallions of special cases big, bulky code, mentally exhausting is there any 'best practice' to avoid index out of bound cases, especially when u have less control over the list basically i want my code to just run,...
by hs
Wed Mar 05, 2008 12:57 pm
Forum: newLISP newS
Topic: list index out of bounds
Replies: 9
Views: 3941

list index out of bounds

can we have it graciously not to stop the running program? personally i like the old way of returning the last element it's because my program input can sometimes be an empty list (i have no control of my data source) (set 'b '()) (b 0);program stops running (b -1);progam stops running (0 1 b);progr...
by hs
Sun Aug 05, 2007 9:09 am
Forum: newLISP newS
Topic: slice negative counter
Replies: 6
Views: 4215

looks like you can now do this! 9.1.11 release notes negative second length in slicing now interpreted as offset from the right: (2 3 "abcdefg") => "cde", (2 -3 "abcdefg") => "cd" before negative length would be interpreted as going to the end it's inclusive in left endpoint and non-inclusive at th...
by hs
Wed Jul 25, 2007 11:17 am
Forum: newLISP newS
Topic: slice negative counter
Replies: 6
Views: 4215

slice negative counter

Hi all! it's probably been discussed before but i haven't searched enough (i got the result on negative offset for slice) is there any easy way to get negative counter act as position? inclusive start and end like: (set 'a '(1 2 3 4 5 6 7)) (2 -2 a) ;want (3 4 5 6), newlisp gives (3 4 5 6 7) in code...
by hs
Sun Sep 03, 2006 9:14 am
Forum: newLISP newS
Topic: matrix addition/subtraction/init
Replies: 1
Views: 2567

matrix addition/subtraction/init

hi all can we easily initialize a matrix by setting it to some array? do we have matrix built-in function other than invert, multiply, transpose? battery-included init, add, sub, determinant, size functions are nice to have i played with matrix for a bit and i feel my code's long: (set 'a (array-lis...