Yes, different ways of writing regular expressions can drastically change performance. Complex expressions involving a bunch of "|"s will obviously take longer.
Eddie
Search found 294 matches
- Fri Feb 25, 2005 5:10 pm
- Forum: newLISP in the real world
- Topic: About parse and scannig
- Replies: 7
- Views: 4856
- Fri Feb 25, 2005 3:12 pm
- Forum: newLISP in the real world
- Topic: About parse and scannig
- Replies: 7
- Views: 4856
- Fri Feb 18, 2005 5:24 pm
- Forum: Anything else we might add?
- Topic: Is it there a better way to read a file in a list ?
- Replies: 4
- Views: 3212
I'm always having to work with reports. A nice thing about newLISP is the fact I can read and parse a tab delimited file exported from Excel, Access, whatever in a one liner: (setq data (map (fn (x) (parse x "\t")) (replace "\r" (parse (read-file in-file) "\n")))) Note that with (replace "\r" (parse...
- Wed Feb 09, 2005 2:41 pm
- Forum: newLISP in the real world
- Topic: What's wrong with this ? (unexpected stack overflow)
- Replies: 9
- Views: 5740
I believe this is a good change since I have been miss-using the macro facility to define what should be functions that use multiple arguments. This of course has led to in some cases, a brick wall. I would rather change the macro definitions in my libraries than change all of my cgi programs. Thank...
- Mon Feb 07, 2005 6:46 pm
- Forum: newLISP in the real world
- Topic: What's wrong with this ? (unexpected stack overflow)
- Replies: 9
- Views: 5740
I thought about using the second possibility you gave. Unfortunately, I would have to rewrite many of my current cgi programs to take (:a '(href="blahblah" style="blahblah") "blahblah"). Not bad notation, but I don't want to rewrite my cgi programs. I should have used this as the solution in the fir...
- Mon Feb 07, 2005 5:15 pm
- Forum: newLISP in the real world
- Topic: What's wrong with this ? (unexpected stack overflow)
- Replies: 9
- Views: 5740
I discovered this accidently Lutz. I have a bunch of html macros that can take any number of arguments of the sort (a href="blahblah" style="blahblah" "Goto blahblah"). I wanted to embed these in some more macros for auto generating documentation. SHEEZE! I gave up on it. I was able to do something ...
- Mon Feb 07, 2005 5:07 pm
- Forum: newLISP newS
- Topic: Newlisp editor mode for (X)Emacs - vim too
- Replies: 2
- Views: 2943
- Fri Feb 04, 2005 10:27 pm
- Forum: Anything else we might add?
- Topic: Extending dolist
- Replies: 1
- Views: 2037
- Fri Jan 21, 2005 2:45 pm
- Forum: newLISP in the real world
- Topic: catch is broken
- Replies: 10
- Views: 6096
- Thu Jan 20, 2005 7:23 pm
- Forum: newLISP in the real world
- Topic: catch is broken
- Replies: 10
- Views: 6096
Thanks! Oh by the way, If you wanted to update your SMTP library. I don't know if you should, but on Linux/Unix boxes, you could add cc and other fields if you need. (define (sendmail to from subject body) (string (exec "/usr/bin/sendmail -t" (format "To: %s\nFrom: %s\nSubject: %s\n\n%s." to from su...
- Thu Jan 20, 2005 6:18 pm
- Forum: newLISP in the real world
- Topic: catch is broken
- Replies: 10
- Views: 6096
- Thu Jan 20, 2005 6:01 pm
- Forum: newLISP in the real world
- Topic: catch is broken
- Replies: 10
- Views: 6096
I think I'm confussing "error-event" and the "throw catch" for the same thing. This is a bit confussing to me. It seems like if a throw occured, then it would signal an error. How can I make a user defined error it would work like throw in C++, Java, Python, Perl, etc, use throw. I would like to cat...
- Thu Jan 20, 2005 5:15 pm
- Forum: newLISP in the real world
- Topic: catch is broken
- Replies: 10
- Views: 6096
I'm not sure I understand? Notice that catch returned true in both of the circumstances above. If this is normal behaviour, how do I force throw to thrown an error condition? Shouldn't the throw clause force an error condition for catch? Otherwise, how is this useful for catching user defined errors...
- Thu Jan 20, 2005 4:27 pm
- Forum: newLISP in the real world
- Topic: catch is broken
- Replies: 10
- Views: 6096
catch is broken
Code: Select all
(define (f x y)
(if (= 0 x)
(throw "x can't be zero")
(+ x y)))
> (catch (f 0 2) 'result)
true
>result
"x can't be zero"
> (catch (f 1 1) 'result)
true
> result
2
Eddie
- Wed Jan 19, 2005 4:21 pm
- Forum: Whither newLISP?
- Topic: Questions on Syntax from a newLisp Newbie
- Replies: 12
- Views: 9533
Oops. Yes I made a mistake. (join ("hello" "world") ":") => "hello:world" Also, Lutz, I think there should be a "->[ ]" after the "[*]->[4]->[3]" correct? After looking at a bunch of Lisp dialects, schemes, goo, and NEWLisp, I'm finding things I like about all of the different dialects and language ...
- Wed Jan 19, 2005 2:42 pm
- Forum: Whither newLISP?
- Topic: Questions on Syntax from a newLisp Newbie
- Replies: 12
- Views: 9533
- Wed Jan 19, 2005 2:39 pm
- Forum: Whither newLISP?
- Topic: Questions on Syntax from a newLisp Newbie
- Replies: 12
- Views: 9533
Nice tutorial. Coming from the imperative side of things, I also faced such challenges. The biggest one for me was (f x0 x1 ... xn) in Lisp == f(x0, x1, ..., xn) in Python, Perl, C, Java, etc,... Once I figured out that the first thing after the beginning "(" was an operation that operated on everyt...
- Mon Jan 10, 2005 3:38 pm
- Forum: Anything else we might add?
- Topic: String Lists
- Replies: 4
- Views: 3168
I know Perl uses:
Just curious, what is it in Python
Code: Select all
qw/cat dog rat bat/
- Wed Jan 05, 2005 2:00 pm
- Forum: newLISP in the real world
- Topic: an empty problem...
- Replies: 12
- Views: 7344
- Wed Jan 05, 2005 1:50 pm
- Forum: newLISP in the real world
- Topic: an empty problem...
- Replies: 12
- Views: 7344
I'm not sure what the stamped-name means but here is my shot at it.
Eddie
Code: Select all
(let (file-content (read-file (append notespath note)))
(if (empty? file-content)
(write-file (append notespath stamped-name))
file-content))
- Fri Dec 17, 2004 5:28 pm
- Forum: newLISP in the real world
- Topic: max
- Replies: 7
- Views: 4893
The input file is a tab delimited file generated from ODBC through our database. I have no choice about the date values. There are quite a number of things that I have to apply a rule base or calculate. Your solution of converting dates to numerical format and then using max is a good one. Then, I h...
- Fri Dec 17, 2004 2:08 pm
- Forum: newLISP in the real world
- Topic: max
- Replies: 7
- Views: 4893
I was looking for (define-macro (_max) (first (sort (args) '>))) or (define-macro(_max) (last (sort (args))) I know Python has this function because I have used it before. I have a list of dates in Y/M/D order as strings and I needed to get the latest. And so, I did the above. I assume the sort is p...
- Thu Dec 16, 2004 5:21 pm
- Forum: newLISP in the real world
- Topic: max
- Replies: 7
- Views: 4893
max
Would be nice if max and min worked with strings or is this a bad idea?
(max "a" "A" "B" "b" "C") => "b"
Eddie
(max "a" "A" "B" "b" "C") => "b"
Eddie
- Fri Dec 10, 2004 8:25 pm
- Forum: Whither newLISP?
- Topic: expand and define-macro
- Replies: 5
- Views: 5165
- Fri Dec 10, 2004 1:46 pm
- Forum: Whither newLISP?
- Topic: expand and define-macro
- Replies: 5
- Views: 5165