Search found 253 matches

by Tim Johnson
Tue Jan 05, 2010 6:48 pm
Forum: newLISP in the real world
Topic: Binding a value to multiple values
Replies: 8
Views: 2612

Re: Binding a value to multiple values

Hi itistoday: I was aware of your object library, and also aware of newlisp's reference passing (or limitations thereof). Before proceding along your path, or any path that instantiates objects, I'd like to ask your opinion of the following: The example that I cite of python can be expanded to more ...
by Tim Johnson
Tue Jan 05, 2010 4:32 pm
Forum: newLISP in the real world
Topic: Binding a value to multiple values
Replies: 8
Views: 2612

Binding a value to multiple values

Hi: In python I can do this: >>> inner = [] >>> outer1 = [] >>> outer2 = [] >>> outer1.append(inner) >>> outer2.append(inner) >>> inner.append(1) >>> outer1 [[1]] >>> outer2 [[1]] How may I do the same thing in newlisp? > (set 'outer1 '() 'outer2 '()) () > (push inner outer1) (()) > (push inner oute...
by Tim Johnson
Mon Dec 28, 2009 7:53 pm
Forum: newLISP in the real world
Topic: Parsing Markup Tags. Code Optimization
Replies: 12
Views: 3862

Re: Parsing Markup Tags. Code Optimization

Maybe I should elaborate further on my originating intent for this posting. I see that cormullion "gets it", but I fear that other may not: First some history: As a web programmer, I have written a lot of modules in both python and rebol. I need that same functionality from newlisp if I am going to ...
by Tim Johnson
Mon Dec 28, 2009 6:41 pm
Forum: newLISP in the real world
Topic: Parsing Markup Tags. Code Optimization
Replies: 12
Views: 3862

Re: Parsing Markup Tags. Code Optimization

Presumably you can use (push chr buf -1) rather than (append ... Haven't checked but it might be OK. Cool. Would save some 'set forms Also, I think dostring has a built-in indexing - $idx - this might be usable and save you running your own counter. Of course! That cond structure is deep - but why ...
by Tim Johnson
Mon Dec 28, 2009 4:48 pm
Forum: newLISP in the real world
Topic: Parsing Markup Tags. Code Optimization
Replies: 12
Views: 3862

Re: No specifications still

still there is much talk "about" the issue, but no specifications. Tell using very short one-line examples what is input and what is the expected output - otherwise all talk is useless. Supposing you got this as input: <fieldset><legend><a href="javascript:;" onmousedown="toggleCombined('18');"> <f...
by Tim Johnson
Sun Dec 27, 2009 7:12 pm
Forum: newLISP in the real world
Topic: Parsing Markup Tags. Code Optimization
Replies: 12
Views: 3862

Re: Parsing Markup Tags. Code Optimization

There is an O'Reilly book called "Javascript: The Good Parts". It includes a nice parser in the back, only takes 3 pages of very clean code. Perhaps it would be best to include a javascript parser inside your parser? Ted I do a lot with javascript <sigh!> I have javascript functions that load data ...
by Tim Johnson
Sun Dec 27, 2009 6:57 pm
Forum: newLISP in the real world
Topic: Parsing Markup Tags. Code Optimization
Replies: 12
Views: 3862

Re: Parsing Markup Tags. Code Optimization

xytroxon wrote:
Lutz has optimized newLISP for the (push item list -1) form... (So you don't need to use coding tricks ;)
-- xytroxon
Understood.
Thanks!
by Tim Johnson
Sun Dec 27, 2009 4:31 pm
Forum: newLISP in the real world
Topic: Parsing Markup Tags. Code Optimization
Replies: 12
Views: 3862

Re: Parsing Markup Tags. Code Optimization

Hopefully by this time unixtechie groks the issue with javascript.... the code here http://newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=3386 is both shorter and much faster, but doesn't handle the javascript. And I'm sure that is the solution that unixtechie refers to. A more complete (language...
by Tim Johnson
Sat Dec 26, 2009 8:07 pm
Forum: newLISP in the real world
Topic: Parsing Markup Tags. Code Optimization
Replies: 12
Views: 3862

Parsing Markup Tags. Code Optimization

I've written a newlisp function that processes a string and returns a list of of elements where markup tags are separated from plaintext. There is an implementation featured here: http://newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=3386 But it doesn't handle javascript code. The function works ...
by Tim Johnson
Fri Nov 20, 2009 9:14 pm
Forum: newLISP in the real world
Topic: Separating markup from text
Replies: 4
Views: 1742

Re: Separating markup from text

One could use a brute-force, iterate-on-every-character approach that would overcome this problem by consolidating a tag, identifying its type and ignore certain '>s' and '<s'. It would be a performance hit, but the data structure could be stored by 'save and only rebuilt on an mtime check when the ...
by Tim Johnson
Fri Nov 20, 2009 7:26 pm
Forum: newLISP in the real world
Topic: Separating markup from text
Replies: 4
Views: 1742

Re: Separating markup from text

I just did a test and it seems to work fine. I included a simple javascript function between a<script></script> tag. This is great. I recommend this as a native. Between that and xml-parse there would be a powerful tool. BTW: This is the beginning of a project for me: And that is to decompose html t...
by Tim Johnson
Fri Nov 20, 2009 3:51 pm
Forum: newLISP in the real world
Topic: Separating markup from text
Replies: 4
Views: 1742

Separating markup from text

Rebol has a function/refinement called load/markup that parses a string, url or file into alternating text and tags. I would like to be able to do that in newlisp. I've tried xml-parse with no luck, although xml-parse does a wonderful job of parsing individual markup tags into a data structure. Did ...
by Tim Johnson
Thu Oct 29, 2009 3:56 pm
Forum: newLISP newS
Topic: newLISP Fan Club is Moving!
Replies: 39
Views: 20168

Re: newLISP Fan Club is Moving!

Looks like cookies are being set now. Thanks Ryon. I know this has
been a lot of work. I hope you are paid well. I also see that there is a
"notify me" option default to on.
Good work!
tim
by Tim Johnson
Sun Oct 25, 2009 3:47 pm
Forum: newLISP newS
Topic: newLISP Fan Club is Moving!
Replies: 39
Views: 20168

Re: newLISP Fan Club is Moving!

OK.
1) The forum is no longer setting a cookie on my firefox browser
2) Still no option to subscribe (email notification)
Or perhaps I'm not seeing it.
Please advise.
Maybe we need a forum written in Newlisp? :) Just kidding.
tim
by Tim Johnson
Fri Oct 16, 2009 3:20 pm
Forum: newLISP newS
Topic: newLISP Fan Club is Moving!
Replies: 39
Views: 20168

Re: newLISP Fan Club is Moving!

Ryon wrote:Okay, I've found the cookie problem. Let's see if I've fixed it?
Yes. It is now working for me.
Thanks
tim
by Tim Johnson
Fri Oct 16, 2009 1:37 am
Forum: newLISP newS
Topic: newLISP Fan Club is Moving!
Replies: 39
Views: 20168

Re: newLISP Fan Club is Moving!

Tim and HPW, this site is being served with a temporary URL. The URL will be changing soon to newlispfanclub.alh.net, and any of today's bookmarks will be invalid. Do you have enough functionality to hold out for a few days until we get the domain transferred? Not a problem. I haven't used bookmark...
by Tim Johnson
Thu Oct 15, 2009 11:06 pm
Forum: newLISP newS
Topic: newLISP Fan Club is Moving!
Replies: 39
Views: 20168

Re: newLISP Fan Club is Moving!

Sorry Ryon.
Still isn't setting bookmarks for me on Firefox 3.0.14 on Kubuntu Linux 8.04.
thanks
tim
by Tim Johnson
Thu Oct 15, 2009 5:52 pm
Forum: newLISP newS
Topic: newLISP Fan Club is Moving!
Replies: 39
Views: 20168

Re: newLISP Fan Club is Moving!

Looking good. I can now get into the other forums.
But forum is still not remembering my login/password.
It doesn't look like cookies are being set.
Also, I can't see how to subscribe.......
thanks
tim
by Tim Johnson
Thu Oct 15, 2009 3:32 pm
Forum: newLISP newS
Topic: newLISP Fan Club is Moving!
Replies: 39
Views: 20168

Re: newLISP Fan Club is Moving!

I had to click on a picture to get here.
Which one is Lutz in that picture?
Who else in the Newlisp community is there?
thanks
tim
by Tim Johnson
Thu Oct 01, 2009 10:27 pm
Forum: Whither newLISP?
Topic: List context - performance
Replies: 17
Views: 8263

Using the approach that I describe above, I wrote a series of vimscript functions that initialize an object such as I've shown interest in and shown an example of: " --------------------------------------------------------------------------------------- " Given the variable name typed in, expands to...
by Tim Johnson
Wed Sep 30, 2009 5:57 pm
Forum: Whither newLISP?
Topic: List context - performance
Replies: 17
Views: 8263

This is turning out to be a great thread. Lots of ideas for a great list context.
tj
by Tim Johnson
Wed Sep 30, 2009 12:14 am
Forum: Whither newLISP?
Topic: List context - performance
Replies: 17
Views: 8263

Following code is my starting point: (context 'lst) (set 'context-name "lst" ## name of context 'object-name "[none]" ## name of object 'data '() ## list - holds data ) (define(dbg) (println "Class: " context-name " Name: " object-name " Data: " data) ) (define (lst:clear) (set 'data '())) (define (...
by Tim Johnson
Tue Sep 29, 2009 10:46 pm
Forum: Whither newLISP?
Topic: List context - performance
Replies: 17
Views: 8263

Lutz wrote:would it be called 'adjoin' ?
From your manual, I've played with "redefining" protected symbols in contexts,
works good - so append could be re-used with an "object". Which I really like.
thanks
by Tim Johnson
Tue Sep 29, 2009 7:09 pm
Forum: Whither newLISP?
Topic: List context - performance
Replies: 17
Views: 8263

List context - performance

The more I use newlisp the more I like it. Mostly I find 'append to be an exception. I have found myself coding a lot of (set 'res(append res (list "blah" "blah1" "blah2"))) ;; untested This begs (IMHO) for a "reconstructive" (or "destructive", I like "reconstructive" better) function or a context. ...
by Tim Johnson
Sat Sep 26, 2009 1:36 am
Forum: Whither newLISP?
Topic: DSLs, system variable wish, conditional evaluation
Replies: 3
Views: 3000

Your $Depth idea reminds me of the number you see when you using the debugger - wonder if it's the same, and would be easy to adapt? I would guess that $DEPTH would be easy to adapt. The lisp approach to syntax parsing is devilishly simple. All hail John McCarthy! And I (think) would be basically e...