99 Smiley's ahead :)
99 Smiley's ahead :)
Target: 99 newlisp expressions that evaluate to a smiley
Please add yours to the list ;-)
Greetings, Norman.
---
## elegant
((0(fn :->)0)1)
## readable
(reverse {)-:})
## Lispy
(lambda :-)
## Shorter
;-)
## Shortest ;)
;)
## Silent
c:\newlisp -c :-)
## Illigal
c:\newlisp -e "(last (main-args))" :-)
## Nose
(sym(join(map string(flat(0(fn (:)(o)({)})))))))
## Too simple
(sym {:-)})
## Odd
(sym (5(setq $0(string((cons'(sym :-))2)))))
Please add yours to the list ;-)
Greetings, Norman.
---
## elegant
((0(fn :->)0)1)
## readable
(reverse {)-:})
## Lispy
(lambda :-)
## Shorter
;-)
## Shortest ;)
;)
## Silent
c:\newlisp -c :-)
## Illigal
c:\newlisp -e "(last (main-args))" :-)
## Nose
(sym(join(map string(flat(0(fn (:)(o)({)})))))))
## Too simple
(sym {:-)})
## Odd
(sym (5(setq $0(string((cons'(sym :-))2)))))
Last edited by newdep on Tue Apr 26, 2005 11:57 am, edited 1 time in total.
-- (define? (Cornflakes))
## HistoricSmile
(495 3(get-url "http://www-2.cs.cmu.edu/~sef/sefSmiley.htm"))
(495 3(get-url "http://www-2.cs.cmu.edu/~sef/sefSmiley.htm"))
-- (define? (Cornflakes))
Very cool, Norman! If I use that but remove the 'append' call, I get the same thing.
Thanks for making these submissions -- although it seems a time-waster, you've actually been teaching me some points of newLISP programming! For instance, I never really paid attention much to string slicing until reading your entries prompted me to. --Ricky
Thanks for making these submissions -- although it seems a time-waster, you've actually been teaching me some points of newLISP programming! For instance, I never really paid attention much to string slicing until reading your entries prompted me to. --Ricky
(λx. x x) (λx. x x)
Haha..yes its a 100% timewaster indeed ;-)
I just wanted to see how far one would get trying to create smiley's
in newlisp without the direct use of characters.. So it possible ;-)
But indeed the string 'rest function is great, Lutz introduced it in the last
release and one gets very addicted with it...
I think ill quit now targeting the 99 :-)
Ooo btw... the append is indeed a leftover from another one ;-)
Should not be in there..
Regards, Norman.
I just wanted to see how far one would get trying to create smiley's
in newlisp without the direct use of characters.. So it possible ;-)
But indeed the string 'rest function is great, Lutz introduced it in the last
release and one gets very addicted with it...
I think ill quit now targeting the 99 :-)
Ooo btw... the append is indeed a leftover from another one ;-)
Should not be in there..
Regards, Norman.
-- (define? (Cornflakes))
OK, lame, but...
Still lame, but funnier ;-)
laters!
dvd
PS- any way to get the macro to eval itself, so I can write ":- )" on the repl and it gets evaluated? maybe I'm asking too much...
Code: Select all
(silent (dolist (i '(: - ")")) (print i)))
Code: Select all
(define-macro (:- x) (silent (print (string ":-" (first (args))))))
(:- ")")
dvd
PS- any way to get the macro to eval itself, so I can write ":- )" on the repl and it gets evaluated? maybe I'm asking too much...
I think you mean:
because (args) takes only the unassigned arguments, so you have to throw out the 'x. This was a changed in 8.4.2, previously (args) returned all arguments.
Also, why do you use a macro for this? It would only be necessary when passing symbols directly, as in my example.
I did not understand the last question. Do you want to call your fuinction/macro recurselvy? you can do that.
Good to hear from you Excalibor, a lot of folks are very happy with with your newlisp.vim.
Lutz
Code: Select all
(define-macro (:-) (silent (print (string ":-" (first (args))))))
> (:- |)
:- |
Also, why do you use a macro for this? It would only be necessary when passing symbols directly, as in my example.
I did not understand the last question. Do you want to call your fuinction/macro recurselvy? you can do that.
Good to hear from you Excalibor, a lot of folks are very happy with with your newlisp.vim.
Lutz
Aahh... that's why I had to throw the 'x out (I'm using the last development version, 8.5.4; btw, I like the indexing thing! :-)Lutz wrote:I think you mean:
because (args) takes only the unassigned arguments, so you have to throw out the 'x. This was a changed in 8.4.2, previously (args) returned all arguments.Code: Select all
(define-macro (:-) (silent (print (string ":-" (first (args)))))) > (:- |) :- |
Just because... :-) It adds to the sum, still way below the proposed 99, but two less than before... Also, it was an opportunity to keep playing with macros... I'm still thinking in writing a newLISP tutorial that's both useful and fun, but I'm very short of time... Thus I jumped to the last version, and I'm exploring all the changes, lots of them, newlisp is keeping you busy! also, congrats for the korozu.com success, I'm sure it will give newlisp a great boost and lots of exciting new functionality and documentation...Also, why do you use a macro for this? It would only be necessary when passing symbols directly, as in my example.
actually I want to call the macro without the parens :-)I did not understand the last question. Do you want to call your fuinction/macro recurselvy? you can do that.
think about a DSL written on newlisp, it will help to get the parens off the way, to make things easier for others... of course, a parenthetical dsl "enhancing" newlisp would be cool by itself, and that's probably what I would do... but I remember a common lisp tutorial, writting a small game, that managed to get rid of the parens by using macros... i know CL macros are not NL's, but it never hurts to ask :-)
thanks, i've been pretty busy the last months, thus i just walked around the fora, but didn't have time to work on it... i will try to get a newlisp.vim based on 8.5.4 this weekend... no promises, but it's feasible :-)Good to hear from you Excalibor, a lot of folks are very happy with with your newlisp.vim.
Lutz
take care and congrats for a great tool,
dvd
newLISP does not have a 'reader macro function', which could change the behaviour of the source code reader, which is hardcoded in newLISP (and very fast). so there is no ways to get rid of our beloved parenthesis.
An updated newlisp.vim is always included in the source distribuition in the doc directory, I always have been making changes to it as they came up. But it would be good to update it on your web site, as many people run into you site and get it from there.
Lutz
An updated newlisp.vim is always included in the source distribuition in the doc directory, I always have been making changes to it as they came up. But it would be good to update it on your web site, as many people run into you site and get it from there.
Lutz
OK, I was just wondering... I don't dislike parentheses, they are pretty useful ;-) (see? :-)Lutz wrote:newLISP does not have a 'reader macro function', which could change the behaviour of the source code reader, which is hardcoded in newLISP (and very fast). so there is no ways to get rid of our beloved parenthesis.
Done (corrected the version number within the file)An updated newlisp.vim is always included in the source distribuition in the doc directory, I always have been making changes to it as they came up. But it would be good to update it on your web site, as many people run into you site and get it from there.
Lutz
I was thinking in adding some more support for different kinds of things still pending, and if we fix on an autoindent policy, implementing it so it makes autoindent as well...
but it's a bit tricky, so I may fail again, i'll let you know, anyway...
laters!