[Oberon] Oberon-07, recursion and type extension

Jörg Straube joerg.straube at iaeth.ch
Mon Sep 5 22:47:28 CEST 2016


Hi

In the Oberon language definition you find:
type = qualident | ArrayType | RecordType | PointerType | ProcedureType.

ArrayType = ARRAY length {"," length} OF type.

If you wonder how the compiler implements "type", recursion seems quite straightforward...

br, Jörg

> Am 05.09.2016 um 11:48 schrieb Lars <noreply at z505.com>:
> 
>> On Wed, July 27, 2016 3:26 pm, Paul Reed wrote:
>> 
>> You've come across a nasty implementation issue - if you use CASE to
>> temporarily change the type of a parameter, it will temporarily change
>> the definition of the procedure too; so the recursive calls are
> 
> 
> I've always wondered if recursion, is a trick, and overrated (i.e. lisp)
> and should be avoided, or embraced. It is certainly powerful but creates,
> I find, confusing code. Dijkstra was skeptical of recursion at times, and
> proud of it at other times.
> 
> I for one don't find all the tricks up Haskell or Lisps sleeve when using
> recursion to be more readable code, than say, non recursive code that
> avoids recursion as if it is a nasty trick...
> 
> I'm wondering, if recursion is highly over rated and should be used in
> moderation, rather than embracing it like in functional languages... Maybe
> super intelligent humans (clever) can understand all sorts of recursive
> mind games, but should bone simple dumb readable programs contain
> recursion riddled throughout the code everywhere? Or should it be avoided
> and used in moderation?
> 
> I don't mean to claim the original poster of this email thread was abusing
> recursion and riddling it throughout his code, as it was only a small
> example. Rather I wanted to start a small discussion of people's opinion
> on recursion and why everyone thinks it is so great when in fact often it
> seems like a clever trick. It is certainly a different way of thinking
> about a problem, but for humans, with our brain size.. is it worth abusing
> recursion? Functional languages do not consider it abuse, but should it be
> considered abuse?
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20160905/f4a9d38c/attachment.html>


More information about the Oberon mailing list