Re:Loop Exits and Structured Programming: Reopening the Deba...
by GrumpyNl on Monday June 12, 2017 @03:17PM
(#14540160)
Software, what its all about: assignments
if and while loops
[ Parent
| on HN ]
Re:Loop Exits and Structured Programming: Reopening the Deba...
by tuukkah on Monday June 12, 2017 @04:44PM
(#14540962)
Only imperative programming though. (Functional programming is the opposite.)
Re:Loop Exits and Structured Programming: Reopening the Deba...
by eru on Monday June 12, 2017 @05:26PM
(#14541273)
And even in imperative programming, you don't need the loops. At least not as a built-in.
Re:Loop Exits and Structured Programming: Reopening the Deba...
by mort96 on Monday June 12, 2017 @10:18PM
(#14542493)
You don't need ifs either, just conditional goto.
Re:Loop Exits and Structured Programming: Reopening the Deba...
by eru on Tuesday June 13, 2017 @10:17AM
(#14544828)
You 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.
Re:Loop Exits and Structured Programming: Reopening the Deba...
by GrumpyNl on Wednesday June 14, 2017 @05:35AM
(#14551575)
The basics still stands, doesnt matter how you call it or do it different.
Re:Loop Exits and Structured Programming: Reopening the Deba...
by eru on Wednesday June 14, 2017 @10:52AM
(#14553151)
Sorry, 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.