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
(define (create-greeter greeting)
(lambda (n)
(println greeting " " n "!")))
(set 'hello-greeter (create-greeter "Hello"))
(set 'goodbye-greeter (create-greeter "Goodbye"))
(hello-greeter "World")
(goodbye-greeter "World")
Hello World
Goodbye World
(define (rowAsHash res idx)
(set 'h '())
(dotimes (fidx (fieldCount res))
(push (list (sym (fieldName res fidx)) (value res idx fidx)) h))
h)
(pg:query db "SELECT id, code FROM users"
(lambda (rec) ;; rec = result of rowAsHash
(println "Id: " (lookup 'id rec) " code: " (lookup 'code rec))))
((id 10) (code "jdoe"))
(define (rowAsHash res idx)
(set 'h '())
(dotimes (fidx (fieldCount res))
(push (list (fieldName res fidx) (value res idx fidx)) h))
h)
(pg:query db "SELECT id, code FROM users"
(lambda (rec) ;; rec = result of rowAsHash
(println "Id: " (lookup "id" rec) " code: " (lookup "code" rec))))
Id: 10 code: jdoe
(define (seg-name seg val) (if val (nth-set 0 seg val)) (seg 0))
(set 'seg '("NM1" "85" "DEF"))
(println (seg-name seg)) ;; "NM1"
(seg-name seg "HL2")
(println (seg-name seg)) ;; "HL2" ---- that's what I want
(println (seg-name seg)) ;; "NM1" ---- is what I actually get
not sure what you mean, butQuote from: "Lutz"
(set 'lst '((name 20 trim) (age 5 int)))
(print ((lst 0 2) "JEREMY ") "n")
;; Desired output: JEREMYn
invalid function in function print : ((lst 0 2) "JEREMY ")
(define (greet who) (print "Hello " who))
(set 'lst '((name "John" who) (age 10)))
((lst 0 2) (lst 0 1))
(define (special-conversion-function str) (do-something str))
(set 'layout '((name 10) (dob 6 special-conversion-function) (country 2)))
(import-data "file.txt" layout)