Code Select
(define-macro (ttt1 a) (eval a))
(define (ttt) (ttt1 (args)))
(ttt)
> ()
(ttt 1)
> ()
;The workaround:
(define (ttt) (let (x (args)) (ttt1 x))
(ttt 1)
> (1)
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 (global? s)
"(global? 'sym) - return 'sym if it is global, otherwise - nil"
(let (mask (if (= (pack "d" 1) " 00 01") 0x02000000 0x00000200))
(= (& (get-int (last (dump s))) mask) mask)))
;; @syntax (test <t1> (<t2> <t3>) (<t4> <t5>) ...)
;; test
t4Quote
syntax: (test t1 (t2 t3) (t4 t5) ...)
test
testQuote
syntax: (test t1 (t2 t3) (t4 t5) ...)
test
test - a test functionQuote
syntax: (test t1 (t2 t3) (t4 t5) ...)
test
Integers are 64-bit numbers (including the sign bit, 32-bit before version 8.9.7). Valid integers are numbers between -9,223,372,036,854,775,808 and +9,223,372,036,854,775,807.Quote
INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.Quote
SQLITE_INTEGER
(push (sqlite3_column_int pstm i) row -1))
* int* sqlite3_column_int(sqlite3_stmt*, int iCol)
(SQLITE_INTEGER
(set 'pstr (sqlite3_column_text pstm i))
(if (= pstr 0)
(push nil row -1)
(push (int (get-string pstr)) row -1)))
val1|val2
1|null
2|4
3|5
((1 nil)
(2 nil)
(3 nil))
(if (empty? col-types) (set 'col-types (get-types pstm num-cols)))
(set 'col-types (get-types pstm num-cols))
(if
; LINUX and BSDs
(< (& 0xF (last (sys-info))) 3) (set 'library "/usr/local/lib/libsqlite3.so")
; Mac OSX / Darwin
(= (& 0xF (last (sys-info))) 3) (set 'library "/usr/lib/libsqlite3.0.dylib")
; Solaris
(= (& 0xF (last (sys-info))) 4) (set 'library "/usr/local/lib/libsqlite3.so")
; MinGW, Win32
(> (& 0xF (last (sys-info))) 4)
(set 'library (string (env "PROGRAMFILES") "/sqlite3/sqlite3.dll"))
true (println "Cannot load library OS not supported"))
(if
; predefined place
MAIN:libsqlite-path (set 'library MAIN:libsqlite-path)
; LINUX and BSDs
(< (& 0xF (last (sys-info))) 3) (set 'library "/usr/local/lib/libsqlite3.so")
.......
dmi@stone:~$ cat >a.lsp
(define (func1)
(trace true)
(print "in func1"))
(define (func2)
(print "in func2"))
(func1)
(func2)
dmi@stone:~$ newlisp a.lsp
in func1
-----
(define (func2 )
#(print "in func2")#)
[-> 2 ] s|tep n|ext c|ont q|uit >
(define (ticker)
(println (date))
(timer 'ticker 1.0)
)
Wed Nov 22 23:59:54 2006
Wed Nov 22 23:59:55 2006
Wed Nov 22 23:59:56 2006
Wed Nov 22 23:59:57 2006
Wed Nov 22 23:59:58 2006
Wed Nov 22 23:59:59 2006
Thu Nov 23 00:00:00 2006
(:send-email
To "dmi@feautec.pp.ru"
Through "feautec.pp.ru"
From "losthost@narod.ru"
Subject "test subj"
Body "test body")
(define (pair lst)
"(pair lst) - fast pair even number of members"
(array-list (array (/ (length lst) 2) 2 lst)))
(define-macro (: fun)
(apply (sym fun MAIN nil)
(letn (pairs
(map (fn (x) (list (eval (sym (first x) fun nil))
(eval (x 1))))
(pair (args)))
m (apply max (map first pairs))
argl (array (+ 1 m)))
(dolist (l pairs)
(nth-set (l 0) argl (l 1)))
(array-list argl))))
(global ':)
(load "/usr/share/newlisp/smtp.lsp")
(context 'send-email)
(set 'From 0 'To 1 'Subject 2 'Body 3 'Through 4)
(define (send-email:send-email from to subj msg srv)
(SMTP:send-mail from to subj msg srv))
(context 'MAIN)
(map set '(a b c ...) (something that returns a list))
(let (a nil b nil c nil)
(map set '(a b c ...) (something that returns a list)))
(let (sym1 expr1 (sym2 sym3 sym4) expr234)
body)
(let sym1 expr1 sym2 nil sym3 nil sym4 nil)
(map set '(sym2 sym3 sym4) expr234)
body)
newLISP v.8.8.8 on linux, execute 'newlisp -h' for more info.
> (context 'CTX)
CTX
CTX> (context 'TEST)
TEST
TEST> (context 'CTX)
CTX
CTX> (symbols)
(CTX:TEST)
CTX> (set 'TEST:a 0)
context expected in function set : CTX:TEST