Search found 6 matches

by varbanov
Mon May 21, 2018 3:56 pm
Forum: newLISP in the real world
Topic: httpd-conf intercept requests and answer with a function?
Replies: 6
Views: 2253

Re: httpd-conf intercept requests and answer with a function

Hi Gregor, For similar purpose I start a server with something like: newlisp.exe -c -d 4780 -w ..\MyProjects\ToWeb (on Windows OS) In ..\MyProjects\ToWeb I've put index.cgi which might look like (minimalistic): #!/usr/bin/newlisp (print "Content-type: text/html\r\n\r\n") (module "cgi.lsp") (define (...
by varbanov
Wed Aug 23, 2017 12:38 pm
Forum: newLISP in the real world
Topic: set - setf - setq woes
Replies: 6
Views: 1807

Re: set - setf - setq woes

Hi, Shortly, set is a "classical" function - it evaluates its arguments. That's why you quoted vowels - to prevent evaluation. setq and setf are synonyms in NewLisp. The names are inherited from other (Common) Lisps. They are "special forms". If the first argument is a symbol, the value of the evalu...
by varbanov
Fri Aug 18, 2017 1:33 pm
Forum: newLISP in the real world
Topic: Why is the behavior of "trim" function so strange?
Replies: 11
Views: 2993

Re: Why is the behavior of "trim" function so strange?

Hi, I'm still on a previous version and there's no problem ... newLISP v.10.6.2 32-bit on Win32 IPv4/6 UTF-8 libffi, options: newlisp -h > (setq str (dup "\000" 32)) "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" > (...
by varbanov
Fri Aug 18, 2017 11:00 am
Forum: newLISP in the real world
Topic: [solved] String interpolation
Replies: 8
Views: 2120

Re: [solved] String interpolation

Hi guys, Sorry for posting on a solved task, but I just can't resist temptation to show my context version . :) No regular expresions, no (explicit) search/replace. :) (define *people* '((("name" "John") ("age" 37) ("city" "NY")) (("name" "Giorgos") ("age" 25) ("city" "Athens")) (("name" "Elena") ("...
by varbanov
Fri Aug 18, 2017 8:19 am
Forum: newLISP in the real world
Topic: Setting up hash items at once
Replies: 2
Views: 1102

Re: Setting up hash items at once

Hi,

Try

Code: Select all

(define cities:cities)         ; creates the default functor
(cities '(("ny" "new york") ("sf" "san francisco")))        ; the functor adds the data
(cities)
s.v.
by varbanov
Wed Aug 07, 2013 8:11 am
Forum: So, what can you actually DO with newLISP?
Topic: Lorem Ipsum
Replies: 2
Views: 3910

Re: Lorem Ipsum

Just for fun, Your definition rewritten ... :)

Code: Select all

(define (lipsum2 (what "paras") (amount 3) (start "true"))
	      ((xml-parse (get-url (format "http://www.lipsum.com/feed/xml?what=%s&amount=%d&start=%s" what amount start)) 7)
	        0 2 0 2 0 1))

(lipsum2)