Search found 52 matches

by Maurizio
Thu Mar 09, 2006 1:24 pm
Forum: newLISP newS
Topic: what's wrong with this ?
Replies: 4
Views: 4130

Thanks, very clear explanation
Maurizio
by Maurizio
Thu Mar 09, 2006 11:24 am
Forum: newLISP newS
Topic: what's wrong with this ?
Replies: 4
Views: 4130

However I don't understand the following example: in context FIRST the x gets the correct value, in context SECOND a pre-definition of x is neeed, otherwise an error occurs. Any suggestion ? Regards Maurizio (context 'FIRST) (define (create aname val) (new FIRST aname) (set 'aname (eval aname)) (set...
by Maurizio
Wed Mar 08, 2006 5:03 pm
Forum: newLISP newS
Topic: what's wrong with this ?
Replies: 4
Views: 4130

what's wrong with this ?

calling sec:init i'm trying to create a new object, of type ctx, in the object sec, but newlisp complains with the following error symbol not in MAIN context in function new : asymbol called from user defined function sec:init this is the program : (context 'CTX) (define (doit) (set 'x 1)) (context ...
by Maurizio
Fri Feb 25, 2005 4:53 pm
Forum: newLISP in the real world
Topic: About parse and scannig
Replies: 7
Views: 4861

I've seen a certain improvement reorganizing the alternatives in the regex so that the patterns that recognize the more frequents tokens are the firsts in the expression. anyway I'm trying with a 130kb file with 15600 tokens. Now the scan time is about 1 second. (pentium 4 - 2.80 ghz, + hyperthreadi...
by Maurizio
Fri Feb 25, 2005 2:32 pm
Forum: newLISP in the real world
Topic: About parse and scannig
Replies: 7
Views: 4861

The speed improvement is about 4/5 times
I mean, before your suggestion the parse time was about 5 seconds,
now only 1 sec.
(I'm just experimenting, I really dont need to parse very big files)

Thanks,

Maurizio
by Maurizio
Fri Feb 25, 2005 9:54 am
Forum: newLISP in the real world
Topic: About parse and scannig
Replies: 7
Views: 4861

Thank you very much.

btw, it seems to me
(push $0 tokens -1)

and not
(push $1 tokens -1)

Regards
Maurizio
by Maurizio
Thu Feb 24, 2005 4:07 pm
Forum: newLISP in the real world
Topic: About parse and scannig
Replies: 7
Views: 4861

About parse and scannig

I try to parse a text file separating every "word" according to a regular expression. The code is reported below What I see, is that even with a moderate text file (190k) it is very slow. I suppose this is due to the continuos string splitting after each succesfull parse. Any suggestion ? Btw, shoul...
by Maurizio
Fri Feb 18, 2005 1:35 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

Thank you very much
Maurizio
by Maurizio
Fri Feb 18, 2005 10:52 am
Forum: Anything else we might add?
Topic: Is it there a better way to read a file in a list ?
Replies: 4
Views: 3212

Is it there a better way to read a file in a list ?

I'd like to read a file in a list, having each line as a separate string. I've tried this, but it seems to me a little clumsy. Is it there a better way ? Regards Maurizio (define (read-my-file) (set 'lst '()) (set 'in-file (open "myfile.txt" "read")) (while (read-line in-file) (set 'lst (append lst ...
by Maurizio
Thu Feb 10, 2005 11:51 am
Forum: newLISP in the real world
Topic: What's wrong with this ? (unexpected stack overflow)
Replies: 9
Views: 5748

Great little change !
thank you very much.
Maurizio
by Maurizio
Mon Feb 07, 2005 2:18 pm
Forum: newLISP in the real world
Topic: What's wrong with this ? (unexpected stack overflow)
Replies: 9
Views: 5748

Thanks, I'll do that. Anyway I suppose there is something wrong about it. I'm required to know the internal details of any macros before I'm able to use them ? What if I use someone other's code ? Perhaps simply I cannot use directly any of my macros as a parameter to someone other's code ? Regards ...
by Maurizio
Mon Feb 07, 2005 9:32 am
Forum: newLISP in the real world
Topic: What's wrong with this ? (unexpected stack overflow)
Replies: 9
Views: 5748

What's wrong with this ? (unexpected stack overflow)

the following program gives an overflow error I'm using vers 8.3.6 on win2k Regards Maurizio (define (tostring argos) (join (map eval argos) " ")) (define-macro (packleft) (tk "pack " (tostring (args)))) (define (test) (tk "toplevel .main") (set 'aname (tk "button .main.1")) (set 'asecond (tk "butto...
by Maurizio
Fri Jun 04, 2004 7:02 am
Forum: newLISP in the real world
Topic: Block comments
Replies: 3
Views: 3296

Thank you very much
Maurizio
by Maurizio
Thu Jun 03, 2004 12:53 pm
Forum: Whither newLISP?
Topic: About contexts and context evaluation
Replies: 6
Views: 6134

Thank you very much
now it's a little clearer...
Regards
Maurizio.
by Maurizio
Thu Jun 03, 2004 12:15 pm
Forum: Whither newLISP?
Topic: About contexts and context evaluation
Replies: 6
Views: 6134

in this case, wouldn't

(set 'ctx ctx)

do the same thing as

(set 'ctx (eval ctx))

?
Regards
Maurizio
by Maurizio
Thu Jun 03, 2004 10:31 am
Forum: newLISP in the real world
Topic: Block comments
Replies: 3
Views: 3296

Block comments

would be very fine to have a way to comment out several rows of code
(something like /* and */)
sometimes, while debugging, I found the necessity to
comment out several procedures at once,
and it's very disturbing to have to comment every single line.

Regards
Maurizio
by Maurizio
Thu Jun 03, 2004 9:27 am
Forum: Whither newLISP?
Topic: About contexts and context evaluation
Replies: 6
Views: 6134

About contexts and context evaluation

Looking in the manual, in the parahraph Context as classes,
I see the following statement :

(set 'ctx (eval ctx)) ;; get context out of symbol

I really don't understand it.
Any explanation ?

Regards
Maurizio
by Maurizio
Fri Apr 30, 2004 3:18 pm
Forum: newLISP in the real world
Topic: unexpected echo
Replies: 1
Views: 2241

sorry, i see.

I must remove print in the function definitions

Regards
Maurizio
by Maurizio
Fri Apr 30, 2004 3:10 pm
Forum: newLISP in the real world
Topic: unexpected echo
Replies: 1
Views: 2241

unexpected echo

I'm trying a simple lisp program activated via httpd this is the source : (define (bold text) (print (string "<b>" text "</b>"))) (define (italic text) (print (string "<i>" text "</i>"))) (print "Content-type: text/html\n\n") (print "<html>") (print "<body>") (print (string "<p> this is " (bold "bol...
by Maurizio
Fri Apr 30, 2004 2:08 pm
Forum: newLISP in the real world
Topic: hiding httpd command window
Replies: 2
Views: 2654

Wonderful !
Now it works correctly.
Regards
Maurizio
by Maurizio
Fri Apr 30, 2004 1:37 pm
Forum: newLISP in the real world
Topic: hiding httpd command window
Replies: 2
Views: 2654

hiding httpd command window

is it possible to start newlisp httpd .....
without having a command window floating around ?
I'd like to start the program using a batch file, or a menu or desktop link
and it should run httpd without showing any window,
or better, with a little icon in the tray area....

Regards

Maurizio
by Maurizio
Sun Dec 07, 2003 6:06 pm
Forum: newLISP in the real world
Topic: problem with integer
Replies: 11
Views: 7070

My idea was to test a user-entered argument
to checkit was a proper number.
i've solved the problem with the following function

Code: Select all

(define (number? x,temp)
  (set 'temp (integer x))
  (and temp
     (= x (format "%d" temp))))
Regards
Maurizio
by Maurizio
Sun Dec 07, 2003 9:49 am
Forum: newLISP in the real world
Topic: problem with integer
Replies: 11
Views: 7070

well, but "12a", as well "12xyz" should not be considered an integer !
regards
Maurizio
by Maurizio
Sat Dec 06, 2003 10:43 pm
Forum: newLISP in the real world
Topic: problem with integer
Replies: 11
Views: 7070

problem with integer

it seems that
(integer "12a")
returns 12 instead of nil
it's a bug or a feature ?
(if it's a feature, how can i check for a valid integer ?)

Regards
Maurizio
by Maurizio
Sun Nov 23, 2003 8:21 pm
Forum: newLISP in the real world
Topic: unexpected double evaluation of statement.
Replies: 2
Views: 2707

Thank you very much
Maurizio