Search found 10 matches

by saulgoode
Sun Oct 26, 2014 3:53 am
Forum: newLISP in the real world
Topic: (newbie) Listiness
Replies: 6
Views: 2359

Re: (newbie) Listiness

I'm sure there are Newlispers here who will be able to provide a much better solution (probably with just a single function), but nonetheless perhaps some of the following might spawn some ideas for you. ----------------- > (set 'in-string (read-file "tmp/foo.tmp")) "# stuff to ignore\n123:avc\n234:...
by saulgoode
Mon Apr 29, 2013 11:38 am
Forum: Whither newLISP?
Topic: A pair of lists
Replies: 4
Views: 3802

Re: A pair of lists

cormullion wrote:Do you mean '((a b c) (10 20 30))?
Functionally the pair of lists would be equivalent to '((abc) . (10 20 30)) but when printed, the dotted notation gets removed such that the items in the second list directly follow the first list.

"Indexed list" would still seem a fairly apt term.
by saulgoode
Mon Apr 29, 2013 4:21 am
Forum: Whither newLISP?
Topic: A pair of lists
Replies: 4
Views: 3802

A pair of lists

I am writing a tutorial on developing a Scheme compiler and one of the data structures I am using is a pair of lists, where the car of the pair is a list of the symbols and the cdr of the pair is a list of their values. For example, an a-list of the data might be ' ((a . 10) (b . 20) (c . 30)) And t...
by saulgoode
Tue Apr 09, 2013 12:18 pm
Forum: newLISP newS
Topic: LispNYC holding Lisp project contest
Replies: 2
Views: 5859

LispNYC holding Lisp project contest

LispNYC is holding a contest for programmers, artists, and creators who use or create things with Lisp. It is open to all Lisp-type programming languages: Common Lisp, Scheme, Clojure, and "any recognized dialect of Lisp". I would assume that newLISP qualifies. Registration starts on June 1st. http:...
by saulgoode
Sun Mar 10, 2013 6:18 am
Forum: newLISP in the real world
Topic: How to edit this file using newlisp file APIs
Replies: 7
Views: 1399

Re: How to edit this file using newlisp file APIs

cormullion wrote:

Code: Select all

(write-file input-file (join lines "\n")) 
Aha, join was the function I was missing. I have always been fond of the strbreakup and unbreakupstr functionality of SIOD and GIMP's Script-fu interpreter, and the fact that Newlisp offers this with parse and join is a definite plus.
by saulgoode
Tue Mar 05, 2013 12:30 pm
Forum: newLISP in the real world
Topic: How to edit this file using newlisp file APIs
Replies: 7
Views: 1399

Re: How to edit this file using newlisp file APIs

You are overwriting the characters that follow "CLOUD_ENGINE_HOME=". You may have to split your file into lines and then replace the entire line. For example (note: I do not do much Newlisp coding so there is probably a better way): #!/usr/bin/newlisp (set 'filename (main-args 2)) (set 'entire-file ...
by saulgoode
Thu Nov 08, 2012 10:34 pm
Forum: newLISP in the real world
Topic: How does (define (sum (x 0)) (inc 0 x)) work?
Replies: 8
Views: 1195

Re: How does (define (sum (x 0)) (inc 0 x)) work?

I've traced it, and found that after a (sum 4), sum => (lambda ((x 0)) (inc 4 x))... this confuses me. Consider the syntax diagram for how the expression " (inc 0 x) " might be stored in memory. http://www.kerosenecow.net/data/images/misc/inc-ast.png The 'inc' primitive, when invoked with its first...
by saulgoode
Mon Jun 11, 2012 4:36 am
Forum: newLISP in the real world
Topic: int does not like 08 and 09?
Replies: 5
Views: 1055

Re: int does not like 08 and 09?

Numeric constants that start with a zero are treated as octal numbers, therefore '8' and '9' are not valid digits.
by saulgoode
Sat Jun 02, 2012 9:48 pm
Forum: newLISP and the O.S.
Topic: Vector Linux
Replies: 3
Views: 1637

Re: Vector Linux

The problem you are encountering with libffi stems from Slackware and is described in this thread on LinuxQuestions.org . Basically, the Slackware package for gcc-java includes a version of libffi -- but it does not include the pkgconfig or header files ( Robby Workman considers this a mistake and s...
by saulgoode
Thu Dec 15, 2011 6:18 pm
Forum: So, what can you actually DO with newLISP?
Topic: Web-based arbitrary file grab?
Replies: 2
Views: 3050

Re: Web-based arbitrary file grab?

My speculation is that the problem is arising from the way Apache's mod_write handles parsing (assuming you are using mod_rewrite). Guile developer Andy Wingo offers a good description of this on his weblog.