@olaf
Nothing here yet.
Nothing here yet.
No blogs yet.
I never realized, that picolisp <post> has all batteries included to create a minimalistic form by itself. This is why I can't keep my hands off picolisp: put following lines in a file form-app.l on machine with installed picolisp (html 0 "Simple Post" *Css NIL (<post> NIL *Url (<label> NIL "set *Snippet to: ") (<field> 30 '*Snippet) (<submit> "Send") ) # end <post> # do sth with *Snippet (ht:Prin "display *Snippet: " *Snippet) # ... ) # end <html> then run it from where the file exists with pil @lib/http.l @lib/xhtml.l @lib/form.l --server 8079 form-app.l + and one has immediately a running interactive page on http://localhost:8079 Great! Thanks for your Blog.
Hi Mia, I do like the list part of this article, I never used yoke before (even did'nt know about it), now I will :-) The 'c[a|d]+r' :-) functions in picolisp exist as a tribute for old lisper's, are'nt they? For beginners to (pico)Lisp I would prefer to define (setq first car) # you can call it first-of-list if you want (setq rest-of-list cdr) # rest would overwrite existing picolisp core function For me it was easier to understand and to remember : (first (rest-of-list '(1 2 3 4 5 6)) # same as (cadr '(1 2 3 4 5 6)) -> 2 : (rest-of-list (first '((1 2) 3 4 5 6)) # same as (cdar '((1 2) 3 4 5 6)) -> (2) But for sure, (first (rest-of-list (rest-of-list (rest-of-list '(1 2 3 4 5 6)))) would never ever be used (and therefore never be listed under the 60 most used functions) instead of a simple (cadddr (1 2 3 4 5 6)):-) (By the way, both should return: 4)
Thanks for your nice intro in picolisp coding! I would like to point at the fact, that (print (1 "abc" (d e (f)) 999 ghi)) does only work without a single quote (') in front of the list because of a picolisp distinctive feature: a list starting with a number will not evaluate as a function call - or exactly spoken: "if the CAR of the list is a number, the whole list is returned as it is" To print lists not starting with a number, one has to add the single quote in front of the list to escape evaluation of the list as a function call. (print '("abc" (d e (f)) 999 ghi)) (otherwise picolisp will not print the list and respond: "abc" -- undefined ) In my early days with picolisp I got confused by different code examples with lists being quoted sometimes and being not quoted other times - it took a while until I really checked that simple rule above :-)