Search found 141 matches

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: 57

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: 344

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: 4
Views: 467

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: 4
Views: 467

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: 4
Views: 467

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: 336

"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: 894

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: 894

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: 1148

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: 1148

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: 7
Views: 1959

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: 7
Views: 1959

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: 7
Views: 1959

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: 870

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: 962

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: 7
Views: 1959

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: 1910

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: 1910

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: 1910

Re: Problem to update an array

Thanks.
When will be released a compiled version?
Best regards,
cameyo
by cameyo
Tue Mar 16, 2021 9:50 pm
Forum: newLISP in the real world
Topic: Problem to update an array
Replies: 6
Views: 1910

Problem to update an array

I have the following situation: (setq j (array 256 '(-1))) (setq str "abc") (char (str 1)) ;-> 98 (integer? (char (str 1))) ;-> true Now i want to update a value of the array j : Using the number 98 works: (setf (j 98) 2) ;-> 2 Reference with a variable works too: (setq idx (char (str 1))) ;-> 98 (s...
by cameyo
Tue Mar 16, 2021 5:04 pm
Forum: So, what can you actually DO with newLISP?
Topic: Pandigital Magic Square
Replies: 0
Views: 2094

Pandigital Magic Square

A pandigital magic square (found with newLISP) having n^2 distinct pandigital integers and having the smallest pandigital magic sum. 1035629784 1035728694 1024638795 1024739685 1025639784 1025738694 1034628795 1034729685 1035729684 1035628794 1024738695 1024639785 1025739684 1025638794 1034728695 10...
by cameyo
Fri Feb 12, 2021 8:08 am
Forum: newLISP in the real world
Topic: Project Euler
Replies: 0
Views: 1732

Project Euler

Project Euler https://projecteuler.net/ added newLISP language.
I have solved 102 problems: 1..102.

cameyo
by cameyo
Thu Oct 29, 2020 12:15 pm
Forum: So, what can you actually DO with newLISP?
Topic: Some functions on dates
Replies: 0
Views: 3166

Some functions on dates

; julian day = 0 on monday 1 january 4713 B.C. (-4712 1 1) ;; @syntax (gdate-julian gdate) ;; @description Convert gregorian date to julian day number (valid only from 15 ottobre 1582 A.D.) ;; @param <gdate> gregorian date (year month day) ;; @return julian day number (int) ;; @example ;; (gdate-ju...
by cameyo
Mon Oct 19, 2020 7:25 pm
Forum: newLISP in the real world
Topic: pow function problem
Replies: 2
Views: 1856

Re: pow function problem

Thanks for the explanation
by cameyo
Mon Oct 19, 2020 9:11 am
Forum: newLISP in the real world
Topic: pow function problem
Replies: 2
Views: 1856

pow function problem

I have some problems with the pow function: (pow 3 0.33) ;-> 1.436977652184852 (pow -3 0.33) ;-> 1.#IND In Mathematica (WolframAlpha): 3^0.33 = 1.436977652184852 -3^0.33 = -1.436977652184852 A simple solution: (define (pow-ext x n) (if (< x 0) (sub 0 (pow (sub 0 x) n)) (pow x n))) (pow-ext 3 0.33) ;...