Search found 136 matches

by hartrock
Fri Jul 17, 2015 11:57 am
Forum: newLISP in the real world
Topic: get-url of empty content fails (fixed in 10.6.4)
Replies: 28
Views: 17074

Re: get-url of empty content fails

Thanks: this is good for my usecase (and probably some of others). Some feedback: Inconsistency: Using additional "debug" flag, "list debug" differs from "raw debug", which does not show sent headers: > (get-url "http://localhost/doesNotExist.txt" "list debug") GET /doesNotExist.txt HTTP/1.1 Host: l...
by hartrock
Thu Jul 16, 2015 11:17 am
Forum: newLISP in the real world
Topic: get-url of empty content fails (fixed in 10.6.4)
Replies: 28
Views: 17074

Re: get-url of empty content fails

Let me explain my current usecase a bit (there is no use of newLISP -http mode). Usecase (being topic in this thread) is HTTP-server testing by newLISP scripts, being the clients of an HTTP server. Therefore I wanted to get rid of calling curl commands by newLISP scripts (after getting rid of curl c...
by hartrock
Wed Jul 15, 2015 11:43 am
Forum: newLISP in the real world
Topic: get-url of empty content fails (fixed in 10.6.4)
Replies: 28
Views: 17074

Re: get-url of empty content fails

Thanks: OK now! Another thing (kind of feature request): What about (http-error) for more fine-granular checking of http responses? Currently I have client code like (snippet): (setq res (get-url (append "http://localhost/ViPLab/" r)) net_err (net-error)) (if (not net_err) (if (not (find "^ERR: serv...
by hartrock
Tue Jul 14, 2015 11:52 am
Forum: newLISP in the real world
Topic: get-url of empty content fails (fixed in 10.6.4)
Replies: 28
Views: 17074

Re: get-url of empty content fails

Hello Lutz, first thank you for the very fast reaction! Checking last (just downloaded) devel version gives problems: sr@mad:/tmp/newlisp-10.6.4$ make check ./newlisp qa-dot Testing built-in functions ... make: *** [check] Segmentation fault But: sr@mad:/tmp/newlisp-10.6.4$ ./newlisp qa-dot Testing ...
by hartrock
Fri Jul 10, 2015 2:07 pm
Forum: newLISP in the real world
Topic: get-url of empty content fails (fixed in 10.6.4)
Replies: 28
Views: 17074

get-url of empty content fails (fixed in 10.6.4)

A GET resulting into a reply with Content-Length 0 should be possible: from http://svn.tools.ietf.org/svn/wg/httpbis/specs/rfc7230.html#message.body : The presence of a message body in a request is signaled by a Content-Length or Transfer-Encoding header field. ... ... All 1xx (Informational), 204 (...
by hartrock
Thu Jul 02, 2015 1:14 am
Forum: newLISP in the real world
Topic: [bof?] ++ nil val in hashmap fails -> feature
Replies: 5
Views: 5452

Re: [bof?] ++ nil val in hashmap fails

Thanks for clearifying the difference between symbols and Tree or (ctxt "someKey") hashmap values. My usecase is a state machine modeled by a hash map with string state IDs as keys, where I want to count state changes. So I have two Tree hash maps: one for the states, another for the counters; both ...
by hartrock
Tue Jun 30, 2015 11:37 am
Forum: newLISP in the real world
Topic: [bof?] ++ nil val in hashmap fails -> feature
Replies: 5
Views: 5452

[bof?] ++ nil val in hashmap fails -> feature

sr@mad:~$ newlisp newLISP v.10.6.2 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h > (new Tree 'hm) hm > (hm "foo" (+ (or $it 0) 1)) 1 > (++ (hm "foo")) 2 > ; OK, but: > (++ (hm "bar")) ERR: invalid parameter in function ++ > Is this a bug, or is there a reason for this behavior? It would ...
by hartrock
Mon Jan 06, 2014 9:46 am
Forum: newLISP in the real world
Topic: newlisp-js license?
Replies: 2
Views: 1942

Re: newlisp-js license?

Hello Hans-Peter, Hello Lutz, Most JavaScript Frameworks and library's can be used under MIT-license: http://en.wikipedia.org/wiki/MIT_License How does newlisp-js fit in such enviroment? Can it be used in combination with this Frameworks and with own js and Lisp-code? Or are own js/lisp again data f...
by hartrock
Fri Jan 03, 2014 10:03 am
Forum: newLISP newS
Topic: newLISP in a browser
Replies: 115
Views: 133440

Re: newLISP in a browser

Just a few thoughts: (2) I wonder if there is JS code from other applications, which could be used. I can say something about experiences I've made with development of http://www.evolgo.de/RYT/ some time ago. For user interaction this heavily uses jQuery and jQueryUI as tools for reaching browser co...
by hartrock
Fri Jan 03, 2014 8:48 am
Forum: newLISP newS
Topic: newLISP in a browser
Replies: 115
Views: 133440

Re: newLISP in a browser

HPW wrote: I wonder why the Emscripten-generator/auhor decided to make a popup-promt as the input-element.
To have synchronous input behavior should be the reason; see:
https://github.com/replit/jsrepl#standard-input-hacks
(reached from https://github.com/replit/repl.it#replit).
by hartrock
Thu Jan 02, 2014 12:29 pm
Forum: newLISP in the real world
Topic: (sort) semantics: stable ordering of elements compared '=' ?
Replies: 3
Views: 2137

Re: (sort) semantics: ordering of elements compared '=' ?

This is a property named stability (https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), which depends on the sorting algorithm. Thanks to the pointer: this is the point of my question. I've updated the post title accordingly. Condensed the question could be: is (sort) stable according the l...
by hartrock
Wed Jan 01, 2014 10:33 pm
Forum: Anything else we might add?
Topic: New Year has come: thanks to Lutz
Replies: 3
Views: 4066

New Year has come: thanks to Lutz

[Update 2014-01-02] links: emscripten, Resig's blog entry to asm.js. Beginning of new year and after doing things with newLISP for a while, it is a good time to say thanks to Lutz for: publishing newLISP under a community oriented open source license; being open-minded regarding suggestions for imp...
by hartrock
Sun Dec 29, 2013 9:02 am
Forum: newLISP in the real world
Topic: (sort) semantics: stable ordering of elements compared '=' ?
Replies: 3
Views: 2137

(sort) semantics: stable ordering of elements compared '=' ?

[2. Update 2014-01-02] : it has a stable ordering (see Lutz' reply). [1. Update 2014-01-02] : added 'stable' to title (see replies below). Example: > (setq l '( ("0" 3) ("1" 3) ("2" 3) ("3" 3) ("4" 3) ("foo" 2) ("bar" 4) ("foo" 1) ("bar" 5) ("5" 3) ("6" 3) ("7" 3) ("8" 3) ("9" 3))) (("0" 3) ("1" 3)...
by hartrock
Mon Dec 02, 2013 8:41 pm
Forum: Anything else we might add?
Topic: [proposal] unification: ref for arrays
Replies: 1
Views: 2476

[proposal] unification: ref for arrays

Regarding refs, lists and arrays behave similar, but not the same. There seems to be a possibility for further unification. This works for both: (setq l (sequence 1 10) a (array 10 l)) ;; ;; Applying refs works for both lists and arrays: (setq r (ref 5 l)) (l r) (a r) But getting a ref does only wor...
by hartrock
Sat Nov 30, 2013 5:24 pm
Forum: newLISP in the real world
Topic: [tip] pretty-print honoring terminal column width
Replies: 0
Views: 2230

[tip] pretty-print honoring terminal column width

This should work under most (all?) Linux systems:

Code: Select all

(setq tput_cols (exec "tput cols"))
(if tput_cols (pretty-print (- (int (tput_cols 0)) 11)))
;;
;; then try:
(symbols)
by hartrock
Fri Nov 29, 2013 12:42 am
Forum: Anything else we might add?
Topic: [proposal] unification: using '() as list identity deref arg
Replies: 5
Views: 4550

Re: [proposal] unification: using '() as list identity deref

Thanks: it works like a charm :-)
Could be a speed record from making a proposal to getting it done... :-)
by hartrock
Wed Nov 27, 2013 6:14 pm
Forum: Anything else we might add?
Topic: [proposal] unification: using '() as list identity deref arg
Replies: 5
Views: 4550

[proposal] unification: using '() as list identity deref arg

[update] -> 10.5.6. During writing some code to ease navigation in lists, I've stumbled about something. Let's speak code for itself. Assumed there is a definition for ref-parent and some example list: ;; nil for non-existing parent (define (ref-parent r) (if (null? r) nil (0 -1 r))) ;; (setq l_nes...
by hartrock
Sun Nov 24, 2013 10:47 am
Forum: newLISP newS
Topic: newLISP Development Release v.10.5.5
Replies: 18
Views: 18126

gcc is not guilty [Re: newLISP Development Release v.10.5.5]

Looking at the pointer values passed and assigned and the resultStackIdx, I see that the sequence of assignments is correct. First: args = arrayList(args, FALSE) second: *(++resultStackIdx) = args But incrementing resultStackIdx only works the first time, the second time entering the apply statemen...
by hartrock
Sat Nov 23, 2013 5:55 am
Forum: newLISP newS
Topic: newLISP Development Release v.10.5.5
Replies: 18
Views: 18126

not a gcc bug

[update2] gcc is not guilty; see reply below. Wrong code example has led me to the problem... [update] Wrong code example removed. Note: It seems to be difficult to create an example with minimal code to trigger this bug (have tried a while); so I don't know how to bug report this to the gcc maintai...
by hartrock
Fri Nov 22, 2013 7:40 pm
Forum: newLISP newS
Topic: newLISP Development Release v.10.5.5
Replies: 18
Views: 18126

Re: newLISP Development Release v.10.5.5

Thanks, yes it is definitely a sequence point issue. The following works on all platforms and is the way it is coded now: if(args->type == CELL_ARRAY) { args = arrayList(args, FALSE); pushResult(args); } This is the way I had it coded first and tested everywhere. Then changed it to the short form w...
by hartrock
Fri Nov 22, 2013 12:49 am
Forum: newLISP newS
Topic: newLISP Development Release v.10.5.5
Replies: 18
Views: 18126

[fix] apply mem leak

After some trial and error I've found a solution for apply , which works for me. Try this at the begin of p_apply(): CELL * p_apply(CELL * params) { CELL * expr; CELL * args; CELL * cell; CELL * result; CELL * func; ssize_t count, cnt; UINT * resultIdxSave; CELL * tmp; func = evaluateExpression(para...
by hartrock
Thu Nov 21, 2013 2:55 am
Forum: newLISP newS
Topic: newLISP Development Release v.10.5.5
Replies: 18
Views: 18126

Re: newLISP Development Release v.10.5.5

There is no cell leak or memory leak :) array-list creates a new list but it gets popped off from the result stack in evaluateExpression() after the function returns. The cleanupResults() happens only for the results from the individual apply operations when it had the reduce parameter during the e...
by hartrock
Thu Nov 21, 2013 2:41 am
Forum: newLISP newS
Topic: newLISP Development Release v.10.5.5
Replies: 18
Views: 18126

Re: newLISP Development Release v.10.5.5

More condensed (triggering the same problem):

Code: Select all

(set 'a (array 10000 (sequence 0 10000)))
(time (apply + (0 1000 a)) 10000)
Note: 10000 times may be over too fast.
by hartrock
Thu Nov 21, 2013 2:20 am
Forum: newLISP newS
Topic: newLISP Development Release v.10.5.5
Replies: 18
Views: 18126

Re: newLISP Development Release v.10.5.5

Try this: (set 'a (array 10000 (sequence 0 10000))) ;; (define (til-stats cont divisor) (let ((tilSize (/ (length cont) divisor)) (tils (array divisor))) (dotimes (chunkIx divisor) (let (off (* chunkIx tilSize)) (++ (tils chunkIx) (apply + (off tilSize cont))))) tils)) (define (centil-stats cont) (t...
by hartrock
Thu Nov 21, 2013 1:52 am
Forum: newLISP newS
Topic: newLISP Development Release v.10.5.5
Replies: 18
Views: 18126

Re: newLISP Development Release v.10.5.5

I can confirm, that running your example gives no mem leak. On the other side I trust the 'top' command, if running two variants -- one with, one without array-list (no other changes) -- of code from me: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 21814 sr 20 0 22260 3308 1144 R 99.4 0.2 2...