Search found 608 matches

by TedWalther
Thu Oct 04, 2007 8:08 pm
Forum: newLISP newS
Topic: Recursive indenting of lines in a string?
Replies: 7
Views: 4325

The fun of a Commodore 64, the power of Unix, the readability of Python. I don't know quite what that means, but perhaps it ought to go into http://www.alh.net/newlisp/phpbb/viewtopic.php?t=1128 one day! The Commodore 64 had sound and graphics, a floppy drive, and it worked with your TV set. It was...
by TedWalther
Thu Oct 04, 2007 4:40 am
Forum: newLISP newS
Topic: Recursive indenting of lines in a string?
Replies: 7
Views: 4325

Hi Ted! This (replace "([^\r\n]+)([\r\n]+)" foo (string "\t\t" $1 $2) 4) will meet all your requirements (if I read them correctly), including not putting tabs on blank lines. Cheers, --Rick Rick, thank you! Just what I was wanting. Cormullion, thank you for your solution as well. Boy, newlisp is j...
by TedWalther
Wed Oct 03, 2007 1:22 am
Forum: newLISP newS
Topic: Recursive indenting of lines in a string?
Replies: 7
Views: 4325

Recursive indenting of lines in a string?

(setq foo "a\nb\nc\n") (indent foo "\t\t") => "\t\ta\n\t\tb\n\t\tc\n" Hi guys. I've been fiddling with "replace" and using regex functionality, but not sure how to make it do what I want above. I want the start of every line to have some indent characters inserted, but if it ends with a newline, I d...
by TedWalther
Wed Sep 05, 2007 2:51 am
Forum: Anything else we might add?
Topic: how to make newlisp into another language
Replies: 12
Views: 5603

That's one way. Or perhaps you could investiage a simpler way: (define (string! s) (replace {(\(.*?\))} s (string (eval-string $1)) 0)) (set 'a 1 'b 2 'c 3) (string! {a + b + c = (+ a b c)}) ;-> a + b + c = 6 and you're keeping your white space. I don't think you can get parentheses into symbol nam...
by TedWalther
Tue Sep 04, 2007 5:53 pm
Forum: Anything else we might add?
Topic: how to make newlisp into another language
Replies: 12
Views: 5603

For the (string ...) function, I'd like the reader to evaluate the first argument in the list before proceeding. Then if it is a special, like string, it would "read" the rest of the string appropriately. So, for string, when the reader sees "(string " then it would kick into a mode where everything...
by TedWalther
Tue Sep 04, 2007 4:25 pm
Forum: Anything else we might add?
Topic: how to make newlisp into another language
Replies: 12
Views: 5603

Thanks Cormullion. Your code looks close to what I want. Two issues: 1) I'd like to preserve whitespace between elements of the string, especially carriage returns. 2) Even if whitespace can't be preserved, I'd like to have "symbols" that contain any character at all except for the "(" character, un...
by TedWalther
Tue Sep 04, 2007 5:53 am
Forum: Anything else we might add?
Topic: how to make newlisp into another language
Replies: 12
Views: 5603

Thanks Lutz. I may just have to intersperse {} strings with newlisp code. Not quite the minilanguage I wanted, but close enough to be an improvement over what I have right now. What would it take to make a top-level function (string ...) that was a "special" function the way (lambda) is a special fu...
by TedWalther
Sun Sep 02, 2007 11:58 pm
Forum: Anything else we might add?
Topic: how to make newlisp into another language
Replies: 12
Views: 5603

how to make newlisp into another language

Hi. I want to do something special with NewLISP. I've been told that it is bad procedure, or almost impossible to do in other versions of LISP. I want to integrate the Lilypond minilanguage into Newlisp. I want to have a special function (lilypond ) and everything inside the brackets is interpreted ...