Hi Lutz,
Sometimes REGEX are too slow for simple things that could be better done with the scan, the "inverse" of format.
Do you think it could be possible to have a scan function in newlisp, or have you an alternative to suggest ?
Thanks
Search found 23 matches
- Thu Nov 28, 2013 4:38 pm
- Forum: Anything else we might add?
- Topic: [proposal] We have "format"... could we have "scan" ?
- Replies: 1
- Views: 2343
- Fri Jun 21, 2013 4:33 pm
- Forum: newLISP in the real world
- Topic: Higher level multi-processing
- Replies: 1
- Views: 1625
Higher level multi-processing
Hi! I was playing lately with this : #!/usr/bin/newlisp -n -c (context 'pool) (define (pool:pool task (poolSize 5) (syncDelay 50)) (while (> (length (sync)) poolSize) (sync syncDelay)) (spawn 's (eval task))) (define (pool:map task liste (poolSize 5) (syncDelay 50)) (let (size (- (length liste) 1) o...
- Fri Jun 15, 2012 12:04 pm
- Forum: newLISP in the real world
- Topic: Question about net-eval
- Replies: 3
- Views: 1843
Re: Question about net-eval
Just remove the call to print.
- Wed May 02, 2012 6:57 am
- Forum: newLISP newS
- Topic: newLISP Stable Maintenance Release v.10.4.2
- Replies: 6
- Views: 6189
Re: newLISP Stable Maintenance Release v.10.4.2
Thanks Lutz.
The best keeps getting better...
The best keeps getting better...
- Wed Sep 21, 2011 7:44 am
- Forum: newLISP in the real world
- Topic: threadring in newlisp
- Replies: 36
- Views: 9159
Re: threadring in newlisp
Thanks a lot Lutz. I spent some time rewriting my code with your idea (not waiting for the result, and letting threads end themselves), but conforming to the benchmark specification, and the best i can get is : #!/usr/bin/newlisp (set 'nThreads 503 'limit 500000 'channels '()) ; The worker code (def...
- Tue Sep 20, 2011 6:45 pm
- Forum: newLISP in the real world
- Topic: threadring in newlisp
- Replies: 36
- Views: 9159
threadring in newlisp
I tried to implement the threadring task from the alioth language benchmark , and found my code very slow. It's my first atempt at "multithreading", so i hope someone can help me to make it faster. Here is my code : (set 'nThreads 503 'limit 500000 'channels '()) ; worker do that (define (worker id ...
- Wed Jul 20, 2011 10:27 am
- Forum: newLISP newS
- Topic: LUA OR Newlisp
- Replies: 5
- Views: 7245
Re: LUA OR Newlisp
Lua is "just a language", with far less features and capabilities right out of the box. It's a nice one, but you quickly need to install extensions and libraries. There are lot of them availlable, but that make lua less portable, and harder to manage. On the other side, newlisp is feature rich, and ...
- Thu Mar 03, 2011 11:32 am
- Forum: newLISP in the real world
- Topic: This week's challenge
- Replies: 15
- Views: 4925
Re: This week's challenge
nice move ;-)
I tried something similar, but keeping "sort l" made it nearly the same speed as do-it.
Whithout the sort, you're faster. You don't get the exact same output (not a list), but having the result in a hashtable make accessing individual sublists fast and easy. Cool.
I tried something similar, but keeping "sort l" made it nearly the same speed as do-it.
Whithout the sort, you're faster. You don't get the exact same output (not a list), but having the result in a hashtable make accessing individual sublists fast and easy. Cool.
- Tue Mar 01, 2011 11:23 am
- Forum: newLISP in the real world
- Topic: This week's challenge
- Replies: 15
- Views: 4925
Re: This week's challenge
Yes, Sherlock, that's so true !
Thanks for the dataset.
Thanks for the dataset.
- Tue Mar 01, 2011 6:46 am
- Forum: newLISP in the real world
- Topic: This week's challenge
- Replies: 15
- Views: 4925
Re: This week's challenge
Cool :-) I started initialy by doing it "lispishly", but it apears to be extremely ineficient (but more elegant), due do a lot of copies newlisp have to make and carry along : (define (heads l) (unique (map first l)) ) (define (members l class) (filter (fn (x) (= class (first x))) l) ) (define (doit...
- Mon Feb 28, 2011 4:43 pm
- Forum: newLISP in the real world
- Topic: This week's challenge
- Replies: 15
- Views: 4925
Re: This week's challenge
here's my code :
How does it perform against your big list ?
Code: Select all
(define (do-it l , acc p c)
(setf
acc '()
p -1
c ""
)
(dolist (i (sort l))
(when (!= c (first i))
(setf c (first i))
(inc p)
(push '() acc -1)
)
(push i (acc p) -1)
)
acc
)
- Sat Jan 29, 2011 5:09 pm
- Forum: newLISP in the real world
- Topic: event system
- Replies: 2
- Views: 1904
Re: event system
A little better : (define-macro (with-events _todo_) (let (_fun_ (string (_todo_ 0)) _res_ nil) (eval (EVENTS-BEFORE _fun_)) (setf _res_ (eval _todo_)) (eval (EVENTS-AFTER _fun_)) _res_ ) ) This way, i can do : > (event-before + (setf (_todo_ 2) 100)) > (with-events (+ 4 5 6)) 110 > (event-after + (...
- Sat Jan 29, 2011 4:06 pm
- Forum: newLISP in the real world
- Topic: event system
- Replies: 2
- Views: 1904
event system
I'm exploring ways to add some sort of events in the flow of a script... i would like to have your opinion about how to do this, and how i've done it. Here's my first take with this idea : (new Tree 'EVENTS-BEFORE) (new Tree 'EVENTS-AFTER) (define-macro (event-before target action) (setf target (str...
- Thu Oct 07, 2010 2:55 pm
- Forum: newLISP in the real world
- Topic: newLISP on android ?
- Replies: 4
- Views: 2448
newLISP on android ?
I played with ASE , mainly with the Lua interpreter, and found it pretty cool! I wondered if it could be possible to have newLISP availlable as a scripting engine for ASE. Someone know how to do that ? EDIT : found this doc (http://code.google.com/p/android-scripting/wiki/InterpreterDeveloperGuide) ...
- Fri Sep 03, 2010 5:50 pm
- Forum: newLISP in the real world
- Topic: A big tree / hash problem, maybe a bug
- Replies: 4
- Views: 2073
Re: A big tree / hash problem, maybe a bug
I'm a noob, but i would say that "(random 10 5)" is random but not unique, so it can happens that you get the same key twice or more.
- Thu Sep 02, 2010 2:01 pm
- Forum: Anything else we might add?
- Topic: new to newLISP
- Replies: 20
- Views: 11021
Re: new to newLISP
Thanks a lot Lutz. That's what i ended doing for my website generator, but i was wondering if better ways were availlable. In this case i can have a lot of documents, each one is stored in a context as an association list of fields. This is ok, because each doc have few fileds, even if i can have a ...
- Thu Sep 02, 2010 1:46 pm
- Forum: Anything else we might add?
- Topic: new to newLISP
- Replies: 20
- Views: 11021
Re: new to newLISP
@Lutz : For the idea of storing handles for secondary contexts/dicts, i can't see how to deal easyly with multiple contexts/dicst having the same subkeys. Maybe i have to find a real example where i would use this in "traditional" language, and see if i can refactor it with a more newLISP idiomatic...
- Thu Sep 02, 2010 12:50 pm
- Forum: Anything else we might add?
- Topic: new to newLISP
- Replies: 20
- Views: 11021
Re: new to newLISP
@Lutz : Thanks for this idea Lutz, but that won't do the job. I've done something similar, but with this trick i can't access "intermediate tables". If i have : (MyVar (string "key" "subkey" "endkey1") "value 1") (MyVar (string "key" "subkey" "endkey2") "value 2") I can't get both with : (MyVar (st...
- Wed Sep 01, 2010 9:22 pm
- Forum: Anything else we might add?
- Topic: new to newLISP
- Replies: 20
- Views: 11021
Re: new to newLISP
ah ! ah ! Before coding my website generator in Lua i tried to do it in newlisp... and gave up ! So, i made it with Lua, a language in wich i had no experience, and that was pretty easy. Lua is very good, but miss a lot of the things packed in newLISP. And it's not a lisp. :-) I gave another try, an...
- Wed Sep 01, 2010 3:27 pm
- Forum: Anything else we might add?
- Topic: new to newLISP
- Replies: 20
- Views: 11021
Re: new to newLISP
Hi hilti , nice to learn about your Appigale DSL. Would you mind giving some URLs of sites built on it ? For the HTML generators i was considering a similat idea, but more like : (h1 "This is my text" br "And this is another one") --> <h1>This is my text.<br />And this is another one</h1> First argu...
- Wed Sep 01, 2010 7:47 am
- Forum: Anything else we might add?
- Topic: new to newLISP
- Replies: 20
- Views: 11021
Re: new to newLISP
@m i c h a e l : Thanks for your words. I can recognise myself in your description ! Sometimes instead of actualy working i spend days trying other languages. I like that a lot, and so had a look at things like Rebol, Factor, Forth, OCAML... there's a lot of great languages out there ! But work hav...
- Wed Sep 01, 2010 7:24 am
- Forum: Anything else we might add?
- Topic: new to newLISP
- Replies: 20
- Views: 11021
Re: new to newLISP
@itistoday : thanks :-) I know about Dragonfly. I tried it and it's an amazing piece of work. I have to work on my own framework for two reasons : 1 ) to learn newLISP and see how it goes for doing things the way i used to do them with PHP (wich is not "PHPesque"), and 2 ) i realy need something bo...
- Tue Aug 31, 2010 3:14 pm
- Forum: Anything else we might add?
- Topic: new to newLISP
- Replies: 20
- Views: 11021
new to newLISP
Hi everybody ! I'm a new newLISPer from France, and very happy to have found this pragmatic LISP . I use(d) to code in PHP, a few Lua, and had a look at Python, Ruby and Clojure. I like Clojure very much, but for scripting purpose it's not my prefered weapon... you know, Java is so slow to start ! A...