Thus, if that's the reason, you would revise the template printing to add an initial newline
Code Select
(println "n" template)
to serve the This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
(println "n" template)
to serve the
(letex (l l) (let l (+ a b)))
and for a more regular need, I'd define me a macro like the following:
(define-macro (lett)
(if (list? (args 0)) (apply let (args))
(apply let (cons (eval (pop (args))) (args))) ))
(lett l (+ a b))
(set 'jsondata (lookup "products" (lookup "result" alie)))
it'll already have gone into the "products" value part, and therefore my suggested
(map raisins jsondata)
. And, completed with a println it might look like:
(println (join (map raisins jsondata) "n"))
(if (ref '(x ?) y match true) ($it 1) '())
picks and returns the value part, i.e. the second element, of the
(if R ($it 1) '())
serves the purpose of avoiding a bad error if the
(define (raisins jsonitem)
(format "<a href="%s">%s</a>n"<img src="%s">nn"
(string (if (ref '("productUrl" ?) jsonitem match true) ($it 1)))
(string (if (ref '("imageTitle" ?) jsonitem match true) ($it 1)))
(string (if (ref '("imageUrl" ?) jsonitem match true) ($it 1))) ))
(map raisins (if (ref '("producs" ?) jsondata match true) ($it 1) '())
(define (sublists s (i 0) (n (inc (length s))) (N n))
(collect (if (> n 2) (i (dec n) s) (> (setf n (dec N)) 2) ((inc i) (dec n) s))))
That one performed best for me, and (more or less incidentally) it lets you choose a later start point and a max length of the sub lists.
(define (reach s n (f (fn (x) (= n (x 0)))))
(cons n (if s (flat (map (curry reach (clean f s))
(map (curry nth 1) (filter f s)))))))
(define (reachability s)
(map (fn (x) (reach s x)) (sort (unique (flat s)))))
> (reachability '((13 1) (9 19) (4 13) (4 12) (15 8) (3 15) (7 5) (9 4) (11 0) (0 5)))
((0 5) (1) (3 15 8) (4 13 1 12) (5) (7 5) (8)
(9 19 4 13 1 12) (11 0 5) (12) (13 1) (15 8) (19))
(I added a line break for readability)
(define (transD s)
(flat (map (fn (x) (if (1 x) (map (curry list (x 0)) (1 x)) '())) (reachability s)) 1))
> (transD '((13 1) (9 19) (4 13) (4 12) (15 8) (3 15) (7 5) (9 4) (11 0) (0 5)))
((0 5) (3 15) (3 8) (4 13) (4 1) (4 12) (7 5) (9 19) (9 4) (9 13) (9 1) (9 12) (11 0) (11 5) (13 1) (15 8))
; i.e. the input plus implied reach: (3 8) (4 1) (9 13) (9 1) (9 12) (11 5)
(define (trans s (x s) (f (and s (curry intersect (first s)))))
(if s (trans (rest s) (cons (unique (flat (filter f x))) (clean f x))) x))
> (trans '((13 1) (9 19) (4 13) (4 12) (15 8) (3 15) (7 5) (9 4) (11 0) (0 5)))
((7 5 0 11) (9 19 4 13 1 12) (15 8 3))
# Requires arguments to be run as:
# newlisp buildexe.lsp lsp1 lsp2 .... binary
(constant 'ARGS (match '(? "buildexe.lsp" * ?) (main-args)))
(constant 'HEAD "exehead.lsp")
(println "ARGS " ARGS)
(unless ARGS
(write-line 2 "Run with: newlisp buildexe.lsp lsp1 lsp2 .... binary")
(exit 1))
(unless (= (! (format "%s -x %s %s" (ARGS 0) HEAD (ARGS 2))))
(write-line 2 (format "Failed to build %s" (ARGS 2))))
(append-file (ARGS 2) (dup "x" 50))
(dolist (f (ARGS 1))
(let ((s (string (list 'EmbeddedFiles f (read-file f)))))
(append-file (ARGS 2) (string (length s) s))))
(append-file (ARGS 2) " nil ")
(append-file (ARGS 2) (string (list 'load (ARGS 1 0))))
(exit 0)
(constant 'main_load load)
(constant 'main_read-file read-file)
(constant 'main_file? file?)
(define EmbeddedFiles:EmbeddedFiles nil)
(define (override_load _name)
(if (EmbeddedFiles _name) (eval-string (EmbeddedFiles _name) MAIN)
(main_load _name)))
(define (override_read-file _name)
(if (EmbeddedFiles _name) (EmbeddedFiles _name)
(main_read-file _name)))
(define (override_file? _name)
(if (EmbeddedFiles _name) true (main_file? _name)))
(map constant '(load read-file file?)
(list override_load override_read-file override_file?))
(define SELF:SELF (read-file (or (real-path (main-args 0))
(real-path (string (main-args 0) ".exe")))))
(if (null? SELF)
(exit (and (write-line 2 (format "No program %s" (main-args 0))) 1))
(setf override_i (find (dup "x" 50) SELF))
(let ((override_n 50))
(while (number?
(setf override_n
(read-expr SELF MAIN nil (inc override_i override_n))))
(eval (read-expr SELF MAIN nil (inc override_i $count))))
(eval-string SELF MAIN nil (inc override_i $count)))
(exit (and (write-line 2 "No program") 1)))
(exit 0)
(! "cls")
(! "color 0b")
> !cls
> !color 0b
(map println (exec "cls"))
(map println (exec "color 0b"))
(m '(+ 4 5))
is actually the same as
(eval ''(+ 4 5))
Quote from: "dukester"Response header name 'Environment variable TMP not set, assuming /tmp .Content-Type' contains invalid characters, aborting requestQuote