4 ms·
Software, what its all about: assignments if and while loops
by GrumpyNl 9y ago
Software, what its all about: assignments
if and while loops
- tuukkah 9y agoOnly imperative programming though. (Functional programming is the opposite.)
- eru 9y agoAnd even in imperative programming, you don't need the loops. At least not as a built-in.
- mort96 9y agoYou don't need ifs either, just conditional goto.
- eru 9y agoYou don't need ifs nor conditional jumps. Functional calls are truly enough. I can show you how it's done, if you want to see it. Thus you can implement 'if' as a user defined function in eg Haskell. (But I'd advise against the totally if-less style. Pattern matching is just too convenient. (And ifs are just a special case of pattern matching on booleans.)) Pure lambda calculus doesn't I have ifs. If you want to go truly crazy, check out SKI calculus. It doesn't even have lambda abstraction.
- GrumpyNl 9y agoThe basics still stands, doesnt matter how you call it or do it different.
- eru 9y agoSorry, what do you mean? If I may guess: you want to make gotos central? That only holds for compiling to von-Neumann machines. Some other computational structures might not even have instruction pointers to move around.