Menu

Show posts

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

Topics - Fanda

#1
newLISP newS / Shutdown of www.intricatevisions.com
January 05, 2009, 02:52:01 PM
Dear newLISPers!



Website http://intricatevisions.com/">http://intricatevisions.com/ will be shut down on Jan 10th 2009.



Please, download and save anything dear to your heart. Take anything you might find useful:

http://intricatevisions.com/index.cgi?page=newlisp">http://intricatevisions.com/index.cgi?page=newlisp

http://intricatevisions.com/download/newLISP.ini">http://intricatevisions.com/download/newLISP.ini

http://intricatevisions.com/newlispweb/">http://intricatevisions.com/newlispweb/



Sorry for broken links...



Feel free to ask me on this forum (using private message), if you miss/need something from my website.



Many happy moments with newLISP in year 2009!



Greetings, Frantisek
#2
Anything else we might add? / OOP and LISP
November 18, 2007, 03:39:39 AM
There is a nice article from the creator of RLisp. I believe it could help us put together some nice OO system for newLISP.



Object-Oriented dialects of Lisp

http://t-a-w.blogspot.com/2007/06/object-oriented-dialects-of-lisp.html">http://t-a-w.blogspot.com/2007/06/objec ... -lisp.html">http://t-a-w.blogspot.com/2007/06/object-oriented-dialects-of-lisp.html



See these languages (OO+Lisp):

RLisp:

http://taw.chaosforge.org/rlisp/">http://taw.chaosforge.org/rlisp/

e7:

http://www.e7code.org/">http://www.e7code.org/

Goo:

http://people.csail.mit.edu/jrb/goo/">http://people.csail.mit.edu/jrb/goo/

JazzScheme:

http://www.jazzscheme.org/">http://www.jazzscheme.org/



Fanda
#3
For all language geeks and language designers, a must read:



Advanced Programming Language Design

http://www.nondot.org/sabre/Mirrored/AdvProgLangDesign/">http://www.nondot.org/sabre/Mirrored/AdvProgLangDesign/



Chapter 2-3 CONTINUATIONS: IO

"Io" language implemented as Amalthea can be found here:

http://www.guldheden.com/~sandin/amalthea.html">http://www.guldheden.com/~sandin/amalthea.html



Fanda
#4
Because I don't like contexts too much, I implemented a basic OOP framework using nested association lists and lets.



Source code for oop.lsp:

http://www.intricatevisions.com/source/newlisp/oop.lsp">http://www.intricatevisions.com/source/newlisp/oop.lsp



Implementation of http://onestepback.org/articles/poly/">Shapes

http://www.intricatevisions.com/source/newlisp/oop-shapes.lsp">http://www.intricatevisions.com/source/ ... shapes.lsp">http://www.intricatevisions.com/source/newlisp/oop-shapes.lsp



Output:
Drawing a Rectangle at (10,20), width 5, height 6
Drawing a Rectangle at (110,120), width 5, height 6
Drawing a Circle at (15,25), radius 8
Drawing a Circle at (115,125), radius 8
Drawing a Rectangle at (0,0), width 30, height 15


Examples:

http://www.intricatevisions.com/source/newlisp/oop-examples.lsp">http://www.intricatevisions.com/source/ ... amples.lsp">http://www.intricatevisions.com/source/newlisp/oop-examples.lsp



Output:
Setting and getting values:
o1:a = 1
o1:a = 100

Calling functions:
(100 3)
(1 3)
(5 10)
o1:a + o1:b = 103

Composing objects:
Point:  (0 0)
Circle: (0 0 0)
Line:   ((0 0) (3 4))
Line length: 5

Inline composition:
Myobj: ("Hello!" (3.14 -1))


Fanda
#5
There is an interesting interview with designer of REBOL:

http://obligement.free.fr/articles_traduction/itwsassenrath_en.php">http://obligement.free.fr/articles_trad ... ath_en.php">http://obligement.free.fr/articles_traduction/itwsassenrath_en.php



[Found on: http://www.rebol.com/">http://www.rebol.com/ ]
#6
Anything else we might add? / newLISP web framework
October 06, 2007, 11:01:14 AM
Following the example of Cormullion, I am releasing the source code of my website. It's a little bit cut down and reworked version.



Name (for now) is "newLISP web" ;-)))



You can find it here:

http://www.intricatevisions.com/newlispweb/">http://www.intricatevisions.com/newlispweb/



Have fun, Fanda
#7
Anything else we might add? / How did you find newLISP?
October 04, 2007, 04:22:30 AM
I am being curious, how members of this forum found newLISP (except Lutz ;-)



The first time I found it, was here:

http://shootout.alioth.debian.org/">http://shootout.alioth.debian.org/



Website doesn't show newLISP benchmarks anymore. It used to say something like a "LISP implementation with Tk built-in".

At that time, I was looking for a powerful language with Tk interface to do explorative programming. I also wanted to learn LISP (everybody was saying, how cool it is), so it was a good match.



I feel that there are people looking for a language like newLISP and many are pretty happy when they find it. Can we make newLISP more visible?



Fanda
#8
Whither newLISP? / Developing commercial software
August 10, 2007, 07:50:09 AM
Hello!

I am wondering about developing commercial software with newLISP. I would basically wish for:



1) closed source (no need to disclose the source)

2) encrypted source code (since newLISP is interpreted)

3) one simple package (executable with GUI, easy to make)



Any suggestions and ways, how to do it, are very welcome!



Fanda
#9
newLISP in the real world / 'explode' error
July 27, 2007, 06:17:18 AM
Hello Lutz!



Function 'explode' returns strange results when exploding strings and using numbers bigger than the length of a string:



> (explode "abc" 1)
("a" "b" "c")
> (explode "abc" 2)
("ab" "c")
> (explode "abc" 3)
("abc")
> (explode "abc" 4)
("abc00")
> (explode "abc" 5)
("abc0000")
> (explode "abc" 6)
("abc000002")
> (explode "abc" 7)
("abc000002=")
> (explode "abc" 8)
("abc000002=00")
> (explode "abc" 9)
CRASH

(explode "abc" 10)
("abc00k00=0013000")


Exploding lists works ok.



Fanda
#10
Just in case you want to play with fuzzy logic, take a peek:

http://www.intricatevisions.com/index.cgi?page=nlfuzzy">http://www.intricatevisions.com/index.cgi?page=nlfuzzy



You will find a fuzzy logic library and an example of water temperature regulation.



Fanda
#11
Whither newLISP? / parsing numbers (error?)
February 08, 2007, 05:45:06 AM
It seems that there is an error in 'parse'. It behaves differently on different numbers:


> (parse "Feb 07,2007")
("Feb" "07" "," "2007")

> (parse "Feb 08,2007")
("Feb" "0" "8" "," "2007")


> (dotimes (i 20) (println (parse (format "Feb %d,2007" i))))
("Feb" "0" "," "2007")
("Feb" "1" "," "2007")
("Feb" "2" "," "2007")
("Feb" "3" "," "2007")
("Feb" "4" "," "2007")
("Feb" "5" "," "2007")
("Feb" "6" "," "2007")
("Feb" "7" "," "2007")
("Feb" "8" "," "2007")
("Feb" "9" "," "2007")
("Feb" "10" "," "2007")
("Feb" "11" "," "2007")
("Feb" "12" "," "2007")
("Feb" "13" "," "2007")
("Feb" "14" "," "2007")
("Feb" "15" "," "2007")
("Feb" "16" "," "2007")
("Feb" "17" "," "2007")
("Feb" "18" "," "2007")
("Feb" "19" "," "2007")
("Feb" "19" "," "2007")

> (dotimes (i 20) (println (parse (format "Feb 0%d,2007" i))))
("Feb" "00" "," "2007")
("Feb" "01" "," "2007")
("Feb" "02" "," "2007")
("Feb" "03" "," "2007")
("Feb" "04" "," "2007")
("Feb" "05" "," "2007")
("Feb" "06" "," "2007")
("Feb" "07" "," "2007")
("Feb" "0" "8" "," "2007")
("Feb" "0" "9" "," "2007")
("Feb" "010" "," "2007")
("Feb" "011" "," "2007")
("Feb" "012" "," "2007")
("Feb" "013" "," "2007")
("Feb" "014" "," "2007")
("Feb" "015" "," "2007")
("Feb" "016" "," "2007")
("Feb" "017" "," "2007")
("Feb" "01" "8" "," "2007")
("Feb" "01" "9" "," "2007")
("Feb" "01" "9" "," "2007")


Fanda
#12
newLISP newS / 'exists' and 'for-all'
February 05, 2007, 01:18:00 PM
I suggest to rename new functions:

'exists' to 'any'

and

'for-all' to 'all'



Fanda



PS: See

http://newlisp-on-noodles.org/wiki/index.php/Functional_Programming#Predicates">http://newlisp-on-noodles.org/wiki/inde ... Predicates">http://newlisp-on-noodles.org/wiki/index.php/Functional_Programming#Predicates
#13
Anything else we might add? / behaviour of (symbols)
January 12, 2007, 04:52:02 AM
There is one thing that I don't understand about function (symbols). Run this as a script:
(set 's1 (symbols))

(define (f x)
  (let (y 2)
    (+ x y)))

(set 's2 (symbols))

(println (difference s2 s1 true))

(exit)


Output that I get is: (f s2 x y)



My question is: Why 'x' or 'y'? Function 'f' was never called and even if it was - 'x' or 'y' are only temporary symbols.



Thanks for answering, Fanda
#14
New functions:

http://newlisp-on-noodles.org/wiki/index.php/Flow_control">http://newlisp-on-noodles.org/wiki/inde ... ow_control">http://newlisp-on-noodles.org/wiki/index.php/Flow_control



Improved:

http://newlisp-on-noodles.org/wiki/index.php/Function_Testing">http://newlisp-on-noodles.org/wiki/inde ... on_Testing">http://newlisp-on-noodles.org/wiki/index.php/Function_Testing



I am missing some comments, so feel free to express your opinion.



Thank you, Fanda
#15
Anything else we might add? / suggestions and questions
January 11, 2007, 12:50:21 PM
Happy New Year to all!



Some suggestions and questions ;-)



Suggestions:

- flat with an optional parameter of the level of flattening - (flat lst n)
(set 'lst '(((1 2) (3 4)) ((5 6) (7 8))))
(flat lst 1) => ((1 2) (3 4) (5 6) (7 8))
(flat lst 2) => (1 2 3 4 5 6 7 8)

(flat lst 1) == (apply append lst)
(flat lst 2) == (apply append (apply append lst))


- inverse functions to hyperbolic sinh, cosh, tanh => asinh, acosh, atanh



- opposite of empty? == (not (empty? x))

how to name it? - full? or not-empty?



Questions:

- how to convert an expression to a string the same way as the function 'print'? - except by not writing and reading it from a file???
(define (exp-str e)
  (device (open "tmp_file" "write"))
  (print e)
  (close (device))
  (read-file "tmp_file"))

> (set 'e '(begin (set 'x 5) (+ x x)))
(begin
 (set 'x 5)
 (+ x x))

> (exp-str e)
"(begin rn (set 'x 5) rn (+ x x))"

> (println (exp-str e))
(begin
 (set 'x 5)
 (+ x x))
"(begin rn (set 'x 5) rn (+ x x))"


- is there any other way to find out the name of a script which is currently running? - except by calling (main-args)???



Fanda
#16
newLISP newS / mystery quoting
November 27, 2006, 09:17:18 PM
I don't really understand, what's happening in this code and would be happy, if somebody could help me to get more insight:


(define-macro (qq)
  (println (args)))

(define-macro (q)
  (apply qq (args)))


Watch, how calling 'q' with a symbol or a quoted symbol adds another quote:
(q 3) => (3)
(q "abc") => ("abc")
(q x) => ('x)
(q 'x) => (''x)
(q ''x) => ('''x)


Why is that?



Thank you, Fanda
#17
If you need to analyze and process the newLISP source code, try code.lsp at:

http://www.intricatevisions.com/index.cgi?page=nlcode">//http://www.intricatevisions.com/index.cgi?page=nlcode



Here is the compact version of cgi.lsp:


(context 'CGI)
(define (put-page file-name , page start end)
(set 'page (read-file file-name))
(set 'start (find "<%" page))
(set 'end (find "%>" page))
(while (and start end)
(print (slice page 0 start))
(context MAIN)
(eval-string (slice page (+ start 2) (- end start 2)))
(context CGI)
(set 'page (slice page (+ end 2)))
(set 'start (find "<%" page))
(set 'end (find "%>" page)))
(print page))
(define (url-translate str)
(replace "+" str " ")
(replace "%([0-9A-F][0-9A-F])" str (char (int (append "0x" $1))) 1))
(define (get-vars input , var value var-value)
(set 'vars (parse input "&"))
(dolist (elmnt vars)
(if (find "=" elmnt)
(begin
(set 'var (first (parse elmnt "=")))
(set 'value ((+ (find "=" elmnt) 1) elmnt)))
(begin
(set 'var elmnt)
(set 'value "")))
(push (list var (url-translate value)) var-value))
var-value)
(set 'params (env "QUERY_STRING"))
(if (not params) (set 'params ""))
(if params
(set 'params (get-vars params)))
(set 'inline (read-line))
(if inline
(set 'params (get-vars inline)))
(if (not params) (set 'params '()))
(if (env "HTTP_COOKIE")
(dolist (elmnt (parse (env "HTTP_COOKIE") ";"))
(set 'var (trim (first (parse elmnt "="))))
(set 'value (trim (last (parse elmnt "="))))
(push (list var value) cookies))
(set 'cookies '()))
(define (set-cookie var value domain path)
(set 'value (string value))
(print (format "Set-Cookie: %s=%s; domain=.%s; path=%s;n" var value domain path)))
(define (get-cookie keystr)
(lookup keystr cookies) )
(define (get keystr)
(lookup keystr params))
(context 'MAIN)


Or even more compact:
(context 'CGI) (define (put-page file-name , page start end) (set 'page (read-file file-name)) (set 'start (find "<%" page)) (set 'end (find "%>" page)) (while (and start end) (print (slice page 0 start)) (context MAIN) (eval-string (slice page (+ start 2) (- end start 2))) (context CGI) (set 'page (slice page (+ end 2))) (set 'start (find "<%" page)) (set 'end (find "%>" page))) (print page)) (define (url-translate str) (replace "+" str " ") (replace "%([0-9A-F][0-9A-F])" str (char (int (append "0x" $1))) 1)) (define (get-vars input , var value var-value) (set 'vars (parse input "&")) (dolist (elmnt vars) (if (find "=" elmnt) (begin (set 'var (first (parse elmnt "="))) (set 'value ((+ (find "=" elmnt) 1) elmnt))) (begin (set 'var elmnt) (set 'value ""))) (push (list var (url-translate value)) var-value)) var-value) (set 'params (env "QUERY_STRING")) (if (not params) (set 'params "")) (if params (set 'params (get-vars params))) (set 'inline (read-line)) (if inline (set 'params (get-vars inline))) (if (not params) (set 'params '())) (if (env "HTTP_COOKIE") (dolist (elmnt (parse (env "HTTP_COOKIE") ";")) (set 'var (trim (first (parse elmnt "=")))) (set 'value (trim (last (parse elmnt "=")))) (push (list var value) cookies)) (set 'cookies '())) (define (set-cookie var value domain path) (set 'value (string value)) (print (format "Set-Cookie: %s=%s; domain=.%s; path=%s;n" var value domain path))) (define (get-cookie keystr) (lookup keystr cookies) ) (define (get keystr) (lookup keystr params)) (context 'MAIN)


:-)))))



Fanda



PS: Tested, but bugs might be still present. Warning: Use only source code with UNIX-like "n" line breaks. (Inspired by HTML source code of http://www.google.com/">//http://www.google.com/)
#18
newLISP newS / newLISP goodies are moving
October 18, 2006, 04:28:48 PM
I would like to invite you into my new personal website:

http://www.intricatevisions.com/">http://www.intricatevisions.com/



newLISP goodies can be found here:

http://www.intricatevisions.com/index.cgi?page=newlisp">http://www.intricatevisions.com/index.cgi?page=newlisp



Feedback always welcome!



Fanda



PS: It is running newLISP 9.0 ;-)
#19
The giant phone and cable companies are trying to take control of the Internet away from the public and convert it into their own private, corporate network.

http://www.itsournet.org/">http://www.itsournet.org/



How This Affects You:

http://www.itsournet.org/How_This_Affects.php">http://www.itsournet.org/How_This_Affects.php



eBay Government Relations:

http://www.ebaymainstreet.com/">http://www.ebaymainstreet.com/



funny videos at:

http://www.wearetheweb.org/">http://www.wearetheweb.org/



---

Electronic Frontier Foundation (EFF)

http://www.eff.org/">http://www.eff.org/



Fanda
#20
newLISP in the real world / Error in rand
July 09, 2006, 10:41:58 PM
Hello all!



It seems that there is a small error in 'rand':
> (set 'N 10)
10
> (rand 3 N)
(2 0 1 1 0 2 2 2 2 0 2)
> (length (rand 3 N))
11


Length of the generated list should be 10 (= N). 'rand' keeps returning one more than is needed.



This way:

> (rand 5 0)
(4)


Also:
> (rand 5 -1)

never returns result (infinite loop).



- Fanda



PS: I am using newLISP v.8.9.0 on Win32 MinGW