<zgrep>
If I'm recursively making a list with a bunch of cons-es, just out of curiosity, how efficient does it end up being space-wise? Does it initially make build up a chain of unevaluated expressions, and then build the list as it evaluates them? Would the chain take up more space than imperatively making a list would? (Assuming I can make the list in either direction, I guess.) Or does the Racket interpreter try to do clever things in
<zgrep>
certain situations?
Don8742 has joined #racket
<Don8742>
I have multiple versions of Racket installed. Is there a function or setting that enables me to specify a previously installed version of racket to be the current version?
TCZ has quit [Quit: Leaving]
endformationage has joined #racket
orivej has joined #racket
ech has quit [Ping timeout: 240 seconds]
bitmapper has quit [Quit: Connection closed for inactivity]
mmohammadi9812 has quit [Quit: Quit]
Fare has quit [Ping timeout: 260 seconds]
ech has joined #racket
Fare has joined #racket
mmohammadi9812 has joined #racket
rekahsoft has joined #racket
bitmapper has joined #racket
endformationage has quit [Ping timeout: 240 seconds]
Fare has quit [Ping timeout: 260 seconds]
true-grue has joined #racket
Fare has joined #racket
emacsomancer has quit [Read error: Connection reset by peer]
<aliasless>
zgrep: that depends on the nature of your recursive function, if its using linear recursion it has to reach the base case before it evaluates, so each call of that function will take up space. rewriting it to be tail-recursive would give you the space optimization you are looking for
Sgeo has joined #racket
dustyweb has joined #racket
emacsomancer has joined #racket
countvajhula has joined #racket
quipa has joined #racket
Codaraxis has joined #racket
Codaraxis_ has quit [Ping timeout: 246 seconds]
Don8742 has quit [Remote host closed the connection]
mmohammadi9812 has quit [Read error: Connection reset by peer]
mmohammadi9812 has joined #racket
brettgilio has quit [Remote host closed the connection]
brettgilio has joined #racket
countvajhula has quit [Ping timeout: 264 seconds]
true-grue has quit [Read error: Connection reset by peer]
<zgrep>
aliasless: Mmh. That's a fair point, and I'm not sure why it didn't quite register as a possibility earlier (even though that's been pointed out to me in the past).
<zgrep>
Now I'm wondering if the tail-recursion benefits work across functions, say a calls b and b calls a, each in a tail-recursive fashion. I don't see a theoretical reason why it shouldn't be possible, but what happens in reality?
TCZ has joined #racket
<aliasless>
as far as I understand tail calls aren't specific to recursive functions
teardown has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Leaving]
ski has quit [Ping timeout: 260 seconds]
teardown has joined #racket
ski has joined #racket
<ski>
zgrep : yes, it's required
ski has quit [Ping timeout: 264 seconds]
bitmapper has quit [Quit: Connection closed for inactivity]