Search found 147 matches

by cameyo
Fri Jan 14, 2022 2:47 pm
Forum: newLISP in the real world
Topic: Create a function with a function
Replies: 9
Views: 2412

Re: Create a function with a function

Thanks pda
by cameyo
Fri Jan 14, 2022 2:44 pm
Forum: newLISP in the real world
Topic: Hash-map e contexts
Replies: 5
Views: 704

Re: Hash-map e contexts

This works for me:

Code: Select all

(define (hash? hash)
  (and (context? (evals hash))
       (not (list? (evals (sym (term hash) hash nil))))))
With "eval" instead of "evals" (to avoid "Internal server error")
by cameyo
Wed Dec 29, 2021 4:24 pm
Forum: newLISP newS
Topic: Error in 10.7.6
Replies: 12
Views: 442

Re: Error in 10.7.6

Code: Select all

> (push x x)
(?)
> (x 0 0)
ERR: list reference changed
x
Boom
by cameyo
Wed Dec 29, 2021 12:42 pm
Forum: So, what can you actually DO with newLISP?
Topic: Happy New Year
Replies: 0
Views: 103

Happy New Year

(println "Happy New Year " (- 1 (- 2 (- 3 (* 4 (- 5 (+ 6 (* 7 8 9))))))))
by cameyo
Wed Dec 29, 2021 12:40 pm
Forum: newLISP newS
Topic: Error in 10.7.6
Replies: 12
Views: 442

Re: Error in 10.7.6

newlisp 10.7.5. windows 10
(push x x)
(?)
(push x x)
((?) ?)
(first x)
(?)
by cameyo
Thu Dec 16, 2021 5:50 pm
Forum: newLISP newS
Topic: Happy Birthday newLisp
Replies: 5
Views: 527

Re: Happy Birthday newLisp

Congratulations!
by cameyo
Tue Nov 16, 2021 6:18 pm
Forum: So, what can you actually DO with newLISP?
Topic: Library for recreational mathematics
Replies: 0
Views: 327

Library for recreational mathematics

A library (181 functions) for recreational mathematics: yo.zip
https://github.com/cameyo42/newLISP-Note
by cameyo
Fri Nov 05, 2021 2:42 pm
Forum: newLISP newS
Topic: newLISP_in_21_minutes.html, part 2
Replies: 1
Views: 558

Re: newLISP_in_21_minutes.html, part 2

Hi Yussi,
the server forum has some problems to render code and some other chars.
I hope someone fix this.
Thanks for your work
by cameyo
Sat Sep 18, 2021 10:14 am
Forum: newLISP in the real world
Topic: Hash-map e contexts
Replies: 5
Views: 704

Re: Hash-map e contexts

More difficulties:
a context with functor and functions can be a hash-map too.
by cameyo
Fri Sep 10, 2021 8:57 pm
Forum: newLISP in the real world
Topic: Hash-map e contexts
Replies: 5
Views: 704

Re: Hash-map e contexts

Thank you. I'll do some tests.
by cameyo
Thu Sep 09, 2021 3:16 pm
Forum: newLISP in the real world
Topic: Hash-map e contexts
Replies: 5
Views: 704

Hash-map e contexts

How to filter only the contexts that represent a hash-map? Example: (dolist (_el (symbols)) (if (context? (eval _el)) (println (eval _el) {} (length (eval _el))))) ; -> Class 2 ; -> MAIN 0 ; -> Tree 0 ; -> demo 0 ; -> myHash 0 (dolist (_el (symbols)) (if (and (context? (eval _el)) (not (= _el 'MAIN)...
by cameyo
Thu Aug 19, 2021 3:33 pm
Forum: newLISP in the real world
Topic: "Code patterns" translation
Replies: 1
Views: 490

"Code patterns" translation

Italian translation of "Code Patterns in newLISP":
https://github.com/cameyo42/newLISP-Note
cameyo
by cameyo
Fri May 28, 2021 7:41 pm
Forum: newLISP in the real world
Topic: sort list of points
Replies: 1
Views: 1045

Re: sort list of points

Solution found.
(define (cmp x y) (if (= (first x) (first y)) (g.t. (last x) (last y)) (l.t. (first x) (first y))))

Fortran operator g.t. and l.t. don't raise Internal Server Error
by cameyo
Fri May 28, 2021 6:33 pm
Forum: newLISP in the real world
Topic: sort list of points
Replies: 1
Views: 1045

sort list of points

How to sort a list of points (x y) with x ascending and y descending?
I have tried this, but don't work:
(define (comp x y) (and (>= (last x) (last y)) (<= (first x) (first y))))
I can't post all the code... Internal Server Error.
by cameyo
Wed May 12, 2021 7:38 pm
Forum: newLISP in the real world
Topic: List of indexes
Replies: 4
Views: 1402

Re: List of indexes

Thank you guys
Very nice solutions
@rickyboy: "Nota bene" is Italian :-)
by cameyo
Wed May 12, 2021 12:36 pm
Forum: newLISP in the real world
Topic: List of indexes
Replies: 4
Views: 1402

List of indexes

How to create a list of indexes of all the elements of a generic list? Example: Input: (setq lst '(1 (2 (3 4)) (5 6))) (lst 0) 1 (lst 1) (2 (3 4)) (lst 1 0) 2 (lst 1 1) (3 4) (lst 1 1 0) 3 (lst 1 1 1) 4 (lst 2) (5 6) (lst 2 0) 5 (lst 2 1) 6 Output: List of indexes of lst ((0) (1) (1 0) (1 1) (1 1 0)...
by cameyo
Tue May 04, 2021 5:24 pm
Forum: newLISP in the real world
Topic: Create a function with a function
Replies: 9
Views: 2412

Re: Create a function with a function

Thanks again.
I'll test both methods for speed and simplicity.
by cameyo
Tue Apr 27, 2021 7:35 pm
Forum: newLISP in the real world
Topic: Create a function with a function
Replies: 9
Views: 2412

Re: Create a function with a function

It works.
But I would also need to pass the function name as a parameter, for example:

Code: Select all

(make-adder "add10" 10)
Thanks again for the help
by cameyo
Tue Apr 27, 2021 11:37 am
Forum: newLISP in the real world
Topic: Create a function with a function
Replies: 9
Views: 2412

Re: Create a function with a function

Thank you, but it doesn't works. The symbol y is not binded.
I am looking for the most suitable/fastest method of generating functions automatically (passing name of function and parameters).
by cameyo
Thu Apr 08, 2021 1:33 pm
Forum: newLISP in the real world
Topic: IDE for newLISP
Replies: 1
Views: 1025

IDE for newLISP

On the web I found this IDE for newLISP:
https://github.com/DexterLagan/newIDE
by Dexter Santucci

cameyo
by cameyo
Wed Mar 31, 2021 10:53 am
Forum: newLISP in the real world
Topic: error setq symbol with beginn with number
Replies: 2
Views: 1159

Re: error setq symbol with beginn with number

Variable symbols should not start with any of the following characters:
# ; " ' ( ) { } . , 0 1 2 3 4 5 6 7 8 9

see "Syntax of symbol variables and numbers" on newLISP manual
by cameyo
Tue Mar 30, 2021 2:07 pm
Forum: newLISP in the real world
Topic: Create a function with a function
Replies: 9
Views: 2412

Create a function with a function

Function to create a function with name and parameters: (define (make-add name val) (let (f nil) (setq f (string "(define (" name " x) (+ " val " x))")) (setq name (eval-string f)) name)) Creating a function (make-add "sum-10" 10) out: (lambda (x) (+ 10 x)) Using the created function (sum-10 3) out:...
by cameyo
Fri Mar 19, 2021 8:16 pm
Forum: newLISP in the real world
Topic: Problem to update an array
Replies: 6
Views: 2277

Re: Problem to update an array

Very nice.
Thank you.
by cameyo
Thu Mar 18, 2021 7:31 pm
Forum: newLISP in the real world
Topic: Problem to update an array
Replies: 6
Views: 2277

Re: Problem to update an array

Windows and MacOS. But I can wait without any problems.
Thank you.
by cameyo
Wed Mar 17, 2021 6:33 pm
Forum: newLISP in the real world
Topic: Problem to update an array
Replies: 6
Views: 2277

Re: Problem to update an array

Thanks.
When will be released a compiled version?
Best regards,
cameyo