Streams in newLISP

Started by itistoday, February 23, 2008, 03:51:06 PM

Previous topic - Next topic

itistoday

#30
Quote from: "newBert"This reminds me a passage from  http://www.newlisp.org/CodePatterns.html">"Code Patterns in newLISP": http://www.newlisp.org/CodePatterns.html#walking">Recursion or iteration?

;)


It's just that I was translating Scheme code (which supports tail-call recursion) to newLISP. Tail-call recursion is just as fast as iteration (because they're pretty much the same thing, no?)
Get your Objective newLISP groove on.

newBert

#31
Quote from: "itistoday"It's just that I was translating Scheme code (which supports tail-call recursion) to newLISP.


That's what I do most of the time

;)


Quote from: "itistoday"Tail-call recursion is just as fast as iteration (because they're pretty much the same thing, no?)

Personally, I prefer 'tail-call recursion' that I find more intuitive, clearer and more elegant. And I regret it is not optimized in newLISP.

:)



P.S.: that's why I'm still hesitant between Scheme and newLISP (with a slight preference for newLISP ... )
<r><I>>Bertrand<e></e></I> − <COLOR color=\"#808080\">><B>newLISP<e></e></B> v.10.7.6 64-bit <B>>on Linux<e></e></B> (<I>>Linux Mint 20.1<e></e></I>)<e></e></COLOR></r>

Elica

#32
Quote from: "newBert"P.S.: that's why I'm still hesitant between Scheme and newLISP (with a slight preference for newLISP ... )


Why hesitant? Enjoy both!

Say [size=117]NO[/size] to software monogamy.

xytroxon

#33
Quote from: "newBert"
Quote from: "Elica"
Quote from: "itistoday"...without tail-call recursion unfortunately.


What about iteration? It does not gulp down the stack...

 This reminds me a passage from  http://www.newlisp.org/CodePatterns.html">"Code Patterns in newLISP": http://www.newlisp.org/CodePatterns.html#walking">Recursion or iteration?



In any case we can get through!

;)


After consulting the oracle of all knowledge, I found this:

http://en.wikipedia.org/wiki/Common_Lisp">//http://en.wikipedia.org/wiki/Common_Lisp
Quote
Lastly, the Scheme standards documents require tail-call optimization, which the CL standard does not. Most CL implementations do offer tail-call optimization, although often only when the programmer uses an optimization directive. Nonetheless, common CL coding style does not favor the ubiquitous use of recursion that Scheme style prefers -- what a Scheme programmer would express with tail recursion, a CL user would usually express with an iterative expression in do, dolist, loop, or (more recently) with the iterate package.


That makes it official, iteration IS the CORRECT way to do it! ;) LOL
\"Many computers can print only capital letters, so we shall not use lowercase letters.\"

-- Let\'s Talk Lisp (c) 1976

newBert

#34
Quote from: "Elica"
Quote from: "newBert"P.S.: that's why I'm still hesitant between Scheme and newLISP (with a slight preference for newLISP ... )


Why hesitant? Enjoy both!

Say [size=117]NO[/size] to software monogamy.

I agree ... but I have to take into account the limitations of my machine :D



I already have installed many Logo(s), including Elica and aUCBLogo that I really enjoy, PLT-Scheme, OpenLisp, FBSL (a "Freestyle" Basic for Windows), and  occasionally Caml, Python and CLisp with the intention to compare...



... and I admit that sometimes it's all Greek (or Latin) to me ;)



But its really true that one enriches the other, and vice versa. I do not conceive to use only one programming language. Two or three seem acceptable in order to not disperse excessively :)



Moreover it's time that I do the "housework" :D



Well, I keep newLisp and Scheme, and Elica and aUCBLogo, and FBSL (because it is a interpreted Basic, flexible, fast and efficient). And I continue to study while having fun, or to have fun while studying. Because "I do not want to die stupid", as we say in French.



Regards,

B.

:)
<r><I>>Bertrand<e></e></I> − <COLOR color=\"#808080\">><B>newLISP<e></e></B> v.10.7.6 64-bit <B>>on Linux<e></e></B> (<I>>Linux Mint 20.1<e></e></I>)<e></e></COLOR></r>

newBert

#35
Quote from: "xytroxon"That makes it official, iteration IS the CORRECT way to do it! ;) LOL


... and what about the newLISP way? LOL again

;)
<r><I>>Bertrand<e></e></I> − <COLOR color=\"#808080\">><B>newLISP<e></e></B> v.10.7.6 64-bit <B>>on Linux<e></e></B> (<I>>Linux Mint 20.1<e></e></I>)<e></e></COLOR></r>

Elica

#36
Quote from: "Elica"While waiting for permission to post the original paper...


I got a permission. Also, the author was so kind to send me the paper in PDF. I have uploaded it (temporarily) here:



http://elica.net/download/loethe.pdf">http://elica.net/download/loethe.pdf

m35

#37
Thank you for sharing this Elica

itistoday

#38
Quote from: "Elica"I got a permission. Also, the author was so kind to send me the paper in PDF. I have uploaded it (temporarily) here:



http://elica.net/download/loethe.pdf">http://elica.net/download/loethe.pdf


Awesome, thanks for doing that, I've downloaded it and have added it to the list of things I'm going to read. :-)
Get your Objective newLISP groove on.