Search found 168 matches

by cameyo
Wed Jul 27, 2022 12:21 pm
Forum: newLISP newS
Topic: Lisp book
Replies: 0
Views: 112

Lisp book

Lisp Book (Croatian language) by Kazimir Majorinc at:
http://monoskop.org/images/c/cb/Majorin ... moguce.pdf

Traslation in english "As Powerful As Possible" at:
https://github.com/amno1/as-powerful-as-possible
by cameyo
Mon Jul 04, 2022 1:58 pm
Forum: newLISP in the real world
Topic: setq '
Replies: 3
Views: 408

Re: setq '

Solution of my problem:
viewtopic.php?f=16&t=4580
by cameyo
Mon Jul 04, 2022 1:53 pm
Forum: newLISP in the real world
Topic: Function as list
Replies: 0
Views: 120

Function as list

by cameyo
Sun Jun 26, 2022 12:10 pm
Forum: newLISP newS
Topic: newLISP v.10.7.0 Stable Release
Replies: 21
Views: 18001

Re: newLISP v.10.7.0 Stable Release

deleted
by cameyo
Wed Jun 15, 2022 5:20 pm
Forum: newLISP in the real world
Topic: string function
Replies: 4
Views: 245

Re: string function

Ok. I am old...and often confused.
Thanks HPW and Ralph.
by cameyo
Wed Jun 15, 2022 6:06 am
Forum: newLISP in the real world
Topic: string function
Replies: 4
Views: 245

Re: string function

This is normal:

Code: Select all

(string a b)
-> "1020"
(string "a""b")
-> "ab"
This is strange, but you just need to know:

Code: Select all

(string ""a""b"")
-> "1020"
by cameyo
Tue Jun 14, 2022 5:43 am
Forum: newLISP in the real world
Topic: string function
Replies: 4
Views: 245

string function

Why this?

Code: Select all

(setq a 10)
(setq b 20)
(string "'"a" '"b"")
-> "'10 '20"
by cameyo
Sat Jun 04, 2022 5:51 pm
Forum: newLISP in the real world
Topic: setq '
Replies: 3
Views: 408

Re: setq '

Yes.
I know it is wrong, but after:

Code: Select all

(setq 'a 3)
> 3
the symbol a is created, but is nil.
Where is the value 3? ;-)
by cameyo
Wed Jun 01, 2022 4:32 pm
Forum: newLISP in the real world
Topic: setq '
Replies: 3
Views: 408

setq '

Code: Select all

(setq 'a 3)
output: 3
a
output: nil
Which symbol is binded with 3?
How to retrieve it?

p.s. it's only a curiosity
by cameyo
Mon May 30, 2022 5:55 pm
Forum: newLISP in the real world
Topic: List of indexes
Replies: 5
Views: 2352

Re: List of indexes

Faster solution:

Code: Select all

(setq a '(1 (2 (3 4)) (5 6)))
;Indexes
(ref-all nil a (fn (x) true))
((0) (1) (1 0) (1 1) (1 1 0) (1 1 1) (2) (2 0) (2 1))
;Elements
(ref-all nil a (fn (x) true) true)
(1 (2 (3 4)) 2 (3 4) 3 4 (5 6) 5 6)
by cameyo
Sat May 07, 2022 6:31 pm
Forum: So, what can you actually DO with newLISP?
Topic: Decrypt message
Replies: 2
Views: 600

Re: Decrypt message

Solution:
"THIS IS MY NEWLISP SCRIPT THAT EMULATES THE ENIGMA MACHINE FROM WWII."
Code:
https://github.com/cameyo42/newLISP-Not ... .lsp#L4699
by cameyo
Tue May 03, 2022 1:16 pm
Forum: So, what can you actually DO with newLISP?
Topic: Decrypt message
Replies: 2
Views: 600

Re: Decrypt message

Hint: Enigma machine
by cameyo
Sun May 01, 2022 10:51 am
Forum: So, what can you actually DO with newLISP?
Topic: Decrypt message
Replies: 2
Views: 600

Decrypt message

Decrypt this message:
"WQGI XH BJ HKOUHVO MWCAAP EEQG JDRPJMVH XQZ KSWSJJ STHSKGL XXLU TOXF."
by cameyo
Fri Apr 22, 2022 10:36 am
Forum: Anything else we might add?
Topic: Forum is broken
Replies: 0
Views: 346

Forum is broken

I can't post code on this forum.
I hope someone can solve the problem.
Thanks
by cameyo
Thu Apr 07, 2022 7:35 pm
Forum: newLISP in the real world
Topic: Editing the lists in the hash-maps
Replies: 0
Views: 436

Editing the lists in the hash-maps

Example:

Code: Select all

(new Tree 'hh)
(for (i 1 5)
  (setq key (string i))
  (for (k i 1 -1)
    (hh key (if DOLLAR-it (extend (list k) DOLLAR-it)  (list k)))
  )
)
(hh)

Code: Select all

output: (("1" (1)) ("2" (1 2)) ("3" (1 2 3)) ("4" (1 2 3 4)) ("5" (1 2 3 4 5)))
Note: DOLLAR-it is $it
by cameyo
Tue Mar 29, 2022 9:45 am
Forum: So, what can you actually DO with newLISP?
Topic: Cryptarithmetic
Replies: 4
Views: 726

Re: Cryptarithmetic

Hi Ralph, i have two functions to solve puzzle like this: one uses brute-force and the other uses "amb" :-))
https://github.com/cameyo42/newLISP-Not ... .lsp#L9296
by cameyo
Mon Mar 28, 2022 2:06 pm
Forum: So, what can you actually DO with newLISP?
Topic: Cryptarithmetic
Replies: 4
Views: 726

Re: Cryptarithmetic

Code: Select all

((("e" 9) ("f" 7) ("i" 6) ("l" 2) ("n" 1) ("p" 0) ("s" 4) ("u" 5) ("w" 8))
 (("e" 8) ("f" 2) ("i" 3) ("l" 7) ("n" 1) ("p" 0) ("s" 6) ("u" 5) ("w" 4))
 (("e" 9) ("f" 2) ("i" 8) ("l" 7) ("n" 1) ("p" 0) ("s" 4) ("u" 5) ("w" 6)))
by cameyo
Sat Mar 19, 2022 7:22 pm
Forum: So, what can you actually DO with newLISP?
Topic: Cryptarithmetic
Replies: 4
Views: 726

Cryptarithmetic

Solve this (each letter represent a different digit):

Code: Select all

   LISP *
    FUN =
---------
NEWLISP
There are three solution.
p.s. obviously you have to use newlisp :-)
by cameyo
Mon Mar 07, 2022 8:49 pm
Forum: So, what can you actually DO with newLISP?
Topic: ImageMagick
Replies: 0
Views: 397

ImageMagick

With ImageMagick is possible to create an image from within newLISP. ImageMagick : https://imagemagick.org/ The following command of ImageMagick creates an image "image.png" from a text file "pixels.txt": convert pixels.txt image.png The following command of ImageMagick creates an image "image.png" ...
by cameyo
Fri Feb 18, 2022 7:35 pm
Forum: Anything else we might add?
Topic: forum problems?
Replies: 7
Views: 1793

Re: forum problems?

Hope someone will fix this problem...
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: 3848

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

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

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

Happy New Year

(println "Happy New Year " (- 1 (- 2 (- 3 (* 4 (- 5 (+ 6 (* 7 8 9))))))))