Search found 88 matches

by ssqq
Sat Jul 23, 2016 3:43 am
Forum: Anything else we might add?
Topic: array became list in silent
Replies: 1
Views: 4186

Re: array became list in silent

concat two element, invoid array became list in silent (define (concat) (apply _concat (args))) (define (_concat @x @y) (cond ((atom? @x) (cond ((atom? @y) (cons @x @y)) ((array? @y) (cons @x @y)) ((list? @y) (push @y (list @x) -1)) (true (error "error concat data")))) ((array? @x) (cond ((atom? @y)...
by ssqq
Thu Jul 21, 2016 4:40 am
Forum: Anything else we might add?
Topic: primitive function empty? could not accept array
Replies: 13
Views: 13302

Re: primitive function empty? could not accept array

I think array should have empty array, Just like other language.

I think "Not empty array" is a design error.
by ssqq
Sat Jul 16, 2016 11:22 am
Forum: Anything else we might add?
Topic: array became list in silent
Replies: 1
Views: 4186

array became list in silent

When I add a array to list, then index it, it would became list in silent. newLISP v.10.7.0 32-bit on Windows IPv4/6 libffi, options: newlisp -h > (array? ((list 1 (array 3 '(1 2 3)) 3) 1)) nil > (list? ((list 1 (array 3 '(1 2 3)) 3) 1)) true I think array as value, when transfer to expression, it s...
by ssqq
Sat Jul 16, 2016 10:21 am
Forum: Anything else we might add?
Topic: primitive function empty? could not accept array
Replies: 13
Views: 13302

primitive function empty? could not accept array

Code: Select all

> (empty? (array 2 '(1 2)))
ERR: list or string expected : (1 2)
I think any check function could accept any type of data.
by ssqq
Sat Jul 16, 2016 10:19 am
Forum: Anything else we might add?
Topic: How to make destructive function
Replies: 2
Views: 4879

Re: How to make destructive function

thanks, I think macro may be ok!
by ssqq
Fri Jul 15, 2016 9:09 am
Forum: Anything else we might add?
Topic: How to make destructive function
Replies: 2
Views: 4879

How to make destructive function

some newLISP builtin function is destructive, If user want design destructive function, how to make it?

for every argument passed into user function is value, not reference only if value is stored in a functor.
by ssqq
Sun Jul 10, 2016 5:35 am
Forum: Anything else we might add?
Topic: not nil? and not true? value
Replies: 0
Views: 6773

not nil? and not true? value

I found '() is not nil or true? value:

Code: Select all

> (nil? '())
nil
> (true? '())
nil
> (empty? '())
true
> (list? '())
true
> (= '() '())
true
for nil and true is only bool value in newLISP, so everything should be judged with nil? or true?
by ssqq
Fri Jul 08, 2016 1:12 pm
Forum: Anything else we might add?
Topic: functor name error [a..e]
Replies: 2
Views: 5023

Re: functor name error [a..e]

thanks, I get it use 10.6.0, I would try it use 10.7.0.

when I use 10.7.0 it is ok.
by ssqq
Wed Jul 06, 2016 4:35 am
Forum: Anything else we might add?
Topic: Strange reader
Replies: 5
Views: 10974

Re: Strange reader

I think this is a bug.

symbol table should permit "fn" or "lambda" as name.
by ssqq
Wed Jul 06, 2016 4:31 am
Forum: Anything else we might add?
Topic: functor name error [a..e]
Replies: 2
Views: 5023

functor name error [a..e]

> (define a:a) ERR: context expected in function define : a > (define b:b) ERR: context expected in function define : b > (define c:c) ERR: context expected in function define : c > (define d:d) ERR: context expected in function define : d > (define e:e) ERR: context expected in function define : e...
by ssqq
Sun Jul 26, 2015 8:12 pm
Forum: newLISP newS
Topic: newLISP Development release 10.4.6
Replies: 11
Views: 16987

Re: newLISP Development release 10.4.6

YAML is suit for view, C and C++ YAML LIB have been upgrade to 1.1.

http://pyyaml.org/wiki/LibYAML

Anyone could test it in newlisp.
by ssqq
Sun Jul 26, 2015 8:06 pm
Forum: Anything else we might add?
Topic: Ceramic: bring web apps to desktop
Replies: 2
Views: 6466

Re: Ceramic: bring web apps to desktop

Website is so quickly, If give some compare data with other website framework. I think maybe Google would interest with it.
by ssqq
Mon Jul 06, 2015 8:52 am
Forum: Whither newLISP?
Topic: Why first lambda expression is args
Replies: 1
Views: 5303

Why first lambda expression is args

I think first lambda expression should is 'lambda: > (first (lambda (x y) (+ x y))) lambda > (first (fn (x y) (+ x y))) fn > 'lambda lambda > 'fn fn > (cons 'fn '((x y) (+ x y))) (fn (x y) (+ x y)) Why newLISP use args as first elements of lambda expression? Why could not quote *lambda* and *fn*?
by ssqq
Mon Jul 06, 2015 8:44 am
Forum: Anything else we might add?
Topic: add function defined?
Replies: 4
Views: 7131

add function defined?

I think newlisp should add function *defined?*, for all not defined variable is *nil*.

Code: Select all


> (defined? 'var) ; --> nil
> (set 'var nil)
> (defined? 'var) ; --> true
> (delete 'var)
> (defined? 'var) ; --> nil

by ssqq
Thu May 14, 2015 12:19 pm
Forum: Anything else we might add?
Topic: Some Advise about newLISP
Replies: 0
Views: 6195

Some Advise about newLISP

I like newLISP. If put the source code to github. maybe more people could participate in this Project. If Add some function used 'Test` in newLISP core like this: ( is (expression args) result, messsage)) ( ok expression-is-true message) Then could add some test-case in core. So many people could se...
by ssqq
Tue Jan 13, 2015 12:24 pm
Forum: So, what can you actually DO with newLISP?
Topic: un-declare symbols check tool for newLISP
Replies: 1
Views: 5085

un-declare symbols check tool for newLISP

I write a tool for checking un-declare symbol of newLISP code, it need improve more. https://github.com/songzan/Spp/blob/master/strict.lsp If you want test it, pls link it first (or change default *main-args* number): On Winxp: > newlisp -x strict.lsp strict.exe > strict your-script.lsp On Linux: > ...
by ssqq
Tue Jan 13, 2015 12:04 pm
Forum: newLISP in the real world
Topic: Ubuntu 14.04 newLISP repl, up,down,right,left key is valid
Replies: 1
Views: 2215

Ubuntu 14.04 newLISP repl, up,down,right,left key is valid

When I use the key of *up* *down* *right* *left* in REPL with Ubuntu 14.04 shell:

Code: Select all


ssqq@X61:~$ newlisp
newLISP v.10.6.0 32-bit on Linux IPv4/6 UTF-8, options: newlisp -h

> ^[[D^[[C^[[B^[[A^[[A^[[C

I try other shell or ssh tool, same problem. If I missed some compiler file when built newLISP?
by ssqq
Fri Jan 09, 2015 12:28 pm
Forum: newLISP in the real world
Topic: eval context symbol error
Replies: 1
Views: 2025

eval context symbol error

I found if *eval* a symbol, then *eval* the context symbol with this symbol prefix would throw a error.

Code: Select all

> (eval 'c)
nil
> (eval 'c:var)
ERR: context expected in function eval : c
> (context 'c)
c
> (eval 'c:var)
nil
by ssqq
Thu Jan 08, 2015 3:46 am
Forum: Anything else we might add?
Topic: C-style atexit functions?
Replies: 4
Views: 7108

Re: C-style atexit functions?

yes, When we import some module, imported symbols list is useful, when it is not useable, delete it from symbols table also is a good habbit.
by ssqq
Thu Jan 08, 2015 2:32 am
Forum: So, what can you actually DO with newLISP?
Topic: newLISP syntax check tool
Replies: 0
Views: 4946

newLISP syntax check tool

Hi, I write a newLISP syntax check tool with perl6.

https://github.com/songzan/Spp/blob/master/Newlisp.p6

Could pass with all lsp file with contribute package.

found following error:

module/unix.lsp line: 59

Code: Select all

    (import library "getuid")` 
end char is *`*.
by ssqq
Thu Jan 08, 2015 2:19 am
Forum: So, what can you actually DO with newLISP?
Topic: How to set a local 'Contexts Hash'
Replies: 6
Views: 9505

Re: How to set a local 'Contexts Hash'

thanks, it is a good idea.
by ssqq
Thu Jan 08, 2015 1:16 am
Forum: Anything else we might add?
Topic: clean lexical declare symbol
Replies: 1
Views: 5005

Re: clean lexical declare symbol

When delete the lexical symbol, the lambda could not work, even re-set it with nil or other value: > (define (sub-name lexical-args) (add lexical-args)) (lambda (lexical-args) (add lexical-args)) > (sub-name 2) 2 > (delete 'lexical-args) true > (sub-name 2) ERR: symbol is protected : nil called from...
by ssqq
Thu Jan 08, 2015 12:53 am
Forum: Anything else we might add?
Topic: *(quote fn) or (quote lambda)* error
Replies: 2
Views: 5332

Re: *(quote fn) or (quote lambda)* error

Thanks, I use *lambda?* to check if expression starts with *fn* or *lambda*. (lambda? '(fn (x) (add x))) ;--> true to get the symbol of *fn* or *lambda*, could use following code: (sym "fn") ; --> fn (sym "lambda") ; --> lambda then, could check it. > > (list 1 (sym "lambda") (sym "fn")) (1 lambda f...
by ssqq
Wed Jan 07, 2015 2:52 pm
Forum: Anything else we might add?
Topic: clean lexical declare symbol
Replies: 1
Views: 5005

clean lexical declare symbol

I found all lexical declare symbol would contain a records in global symbols table. > (define (sub-name lexical-args) (add lexical-args)) (lambda (lexical-args) (add lexical-args)) > (find "lexical-args" (map term (symbols))) 212 > (delete 'lexical-args) true > (find "lexical-args" (map term (symbol...
by ssqq
Wed Jan 07, 2015 2:22 pm
Forum: Anything else we might add?
Topic: lexical declare function
Replies: 2
Views: 5265

Re: lexical declare function

yes, Perl have too much difference from newLISP.

All of us want write stable, clear, easy to maintain code, also want use for reference from other language have learned.