Has anyone had any experience building and using Newlisp
on the ASUS Eee PC 900?
It has a xandros linux OS, gcc is not in the factory install,
I believe, but is available.
This link should give a look at the little fella....
thanks
tim
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
(set 'safe-value (dup " " (+ 1 (length value))))
(set 'safe-value (dup " " (+ 1 (* 2 (length value)))))
#!/usr/bin/newlisp -w /home/tim -c
;; with .init.lsp at /home/tim
(load ".init.lsp")
(load "/home/tim/.init.lsp")
(println (directory))
shows the files
(context 'g)
(set 'action "Viewing file: testcgi.dbg")
(set 'home "/home/http/run/newlisp")
(set 'log-ex '(".dbg" ".err" ".ok"))
(set 'target-file "testcgi.dbg")
(set 'top-dir "/home/http/run/")
(context 'MAIN)
> (load "session.lsp")
MAIN
> g:top-dir
"/home/http/run/"
> (load "session.lsp" 'gg)
MAIN
> gg:top-dir
nil
> (symbols 'gg)
(gg:g gg:top-dir)
(define (cgi:cgi) ;....
)
(if (not (context? cgi key))
(raise (append "key: ['" key "] not previously set")))
context expected in function context? : cgi:cgi
(context 'hash)
(setq context-name "hash" ## name of context
object-name "[none]" ## name of object
lst '() ## list - may be nested
)
(context 'MAIN)
(define (Hash! l oname)
(local (newhash)
(set 'newhash(new hash 'newhash))
(println "newhash = [" newhash:lst "]") ;; DEBUG newhash
(if l (set 'newhash:lst l))
(println "newhash = [" newhash:lst "]") ;; DEBUG newhash
(if oname (set 'newhash:object-name oname))
(println "newhash = [" newhash:object-name "]") ;; DEBUG newhash
newhash))
> (set 'y (Hash! '((name "tim")) "myhash"))
newhash = [()]
newhash = [((name "tim"))]
newhash = [myhash]
newhash
> y:lst
?
> y:object-name
?
(set 'lst '(
(id001 (name "Anne") (addr (country "USA") (city "New York")))
(id002 (name "Jean") (addr (country "France") (city "Paris")))
))
(set 'myargs '('id002 'addr))
;; ('id002 'addr)
(set 'allargs (append '(lst) myargs))
;; (lst 'id002 'addr)
(apply assoc allargs)
list expected in function assoc : ''id002
(assoc (lst 'id002 'addr))
(set 'f '(putb ltrim ltrims)) ;; previously 'defined functions
(apply global f)
(apply constant f)
(define (transfer user-id password host subdir file-names mode)
(if (string? file-names)(set 'file-names(list file-names)))
(if (= mode PUT)
(and
(dolist (file-name file-names)
(println "<BR>file-name = " file-name) ;; DEBUG file-name
(check-file file-name)
(net-send socket (append "STOR " file-name "rn"))
(send-get-result "STATrn" "1")
(println "opening file")
(set 'fle (open file-name "r"))
(while (> (read-buffer fle 'buffer 512) 0)
(if debug-mode (print "."))
(net-send socket2 buffer 512))
(close fle)
(println "file closed")
)) true)
(set 'FTP:debug-mode true)
(set 'res(FTP:put "*user*" "*pwd*" "www.johnsons-web.com" "/demo/newlisp"
'("usr.lsp" "testcgi.dbg"))
file-names = ("usr.lsp" "testcgi.dbg")
sent:USER *user*
331 Please specify the password.
sent:PASS *pwd*
230 Login successful. Have fun.
sent:CWD /demo/newlisp
250 Directory successfully changed.
sent:TYPE I
200 Switching to Binary mode.
sent:PASV
227 Entering Passive Mode (12,24,138,43,204,222)
file-name = usr.lsp
sent:STAT
150 Ok to send data.
opening file
........file closed
file-name = testcgi.dbg
sent:STAT
(define (foo)
(doargs (i) (println i)))
(foo a b c x e f g)
(set 'lst '(a b c x e f g))
;; Intialize the CGI object
(cgi:on 'cs nil 'placeholder true) ;; assumes that 'cs and 'placholder
;; are already defined
(define (parse-args)
(let((key)(val))
(dolist (item (explode (args)))
(set 'key (last(parse(string(first(first item)))":")))
(set 'val(second(first item)))
(set (sym key) val))) ;; reset the symbol
)