Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Re: block-based programming...

by flyingmoose (Priest)
on Apr 22, 2004 at 17:54 UTC ( #347436=note: print w/replies, xml ) Need Help??

in reply to Re: block-based programming...
in thread block-based programming...

real hardware meant running the code in real life versus on theoretical 'mental' computers. That is, the concept of believing in an infinite stack when reading pseudocode is an error a lot of folks (but probably not you) make.

But rest assured that when I use a compiler and make use of tail recursion, I know whether it will eliminate it or not

Again, this is good for your work, but I do not rest assured people I work with are this smart, nor do I think everyone who takes some of my code (open source, etc) would be this smart. I write C code that has to run on about 10 different platforms, so I guess my domain might lend me more towards paranoia.

I didn't argue that tail recursion was ok in this example. Tail recursion was bad in this example. But you extended it to make some general remarks about tail recursion, and that's where I disagree.

No prob, that was a failure to communicate on my part. There are certaintly algorithms that are best expressed recursively (this is obvious!), but I don't ever think it's a good idea for replacing an infinite (or even long running) loop with a recursive solution just because you can and the compiler is smarter than you ... again, obvious to some, but not to all. A better example of using recursion is in math examples, which I have mentioned, and there are tons of doing things in different ways in Lisp, where that becomes the normal idiom.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://347436]
[Corion]: Maybe doing a double-fork (daemonizing) can make go that information away, but maybe not
[Corion]: But I think my knowledge of unix/Linux datastructures is several decades out of date, so I don't really know what information it keeps on processes
[oiskuu]: The useful bits that relate to your process can be found under /proc/self. What information are you thinking of? Tty name?
[tye]: I just daemonized and getlogin() still knew who I had been.
[tye]: perhaps loginuid ? Not that I concede that something not being in /proc means it is not useful.
[Corion]: tye: That's really interesting, but maybe it is because getlogin() returns the name, or the uid, so if that user has been replaced by another user with the same uid in the meantime, that's no problem to the system...
[davido]: or on ubuntu /var/run/utmp

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2017-06-23 19:36 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (554 votes). Check out past polls.