Do you know where your variables are? | |
PerlMonks |
Re: Algorithms, Datastructures and syntaxby Anonymous Monk |
on Apr 04, 2003 at 15:51 UTC ( [id://248105]=note: print w/replies, xml ) | Need Help?? |
I dont really see what your friend means about a for loop in assembler being a data structure. A for loop in assembler (depending on what this means...) is only a handlful of ops and would probably employ a register as its "data-structure". The only possible idea I have about your freinds point is that sometimes one wishes to treat code as data. And then you could have an algorithm which operates on that data (which is really code) Consider a compiler, it may indeed wish to treat a for loop as data, and modify it in a particular way. Until the code gets executed its still data. And maybe even later. In a tongue-in-cheek way of thinking about it you could say that the algorithm part of a program is every instruction the cpu executes, and the data is everything else. This overlooks the difference between an algorithm and a heuristic, and when code is data and data is code, but whatever. :-)
In Section
Meditations
|
|