On 2018-02-08, at 08:33:37, Bernd Oppolzer wrote:

> Am 08.02.2018 um 15:50 schrieb Martin Ward:
>> 
>> 
>> http://rosettacode.org/wiki/Man_or_boy_test
>> 
> I would like to thank you very much for posting this.
> I never heard about this test before, but I am very fascinated by it,
> and I will try it out in the next days on my New Stanford Pascal compiler,
> as soon as I have time to do it (there is a Pascal version of the test
> on the page you mentioned above).
>  
I glanced very briefly at it.  It depends on nested procedure declarations
which C lacks (and call-by-name? which Pascal lacks).  PL/I?

I think nested procedures were an early manifestation of OO-think:
a block is an object and procedures within it are methods.

Languages such as C eschew nested procedures partly because a procedure
descriptor must consist of two pointers rather than just one.  I vaguely
remember one compiler (but I think it was C) that did this with an extra
indirection: a procedure reference actually pointed to a structure
containing two pointers, one for the entry point and the other for the
stack frame.  Broke a lot of things, especially expectation of portability.

-- gil

Reply via email to