From: ThatWouldBeTelling@thevillage.com   
      
   Anton Ertl wrote:   
   > Stephen Fuld writes:   
   >> No, and I defer to you, or others here, on how these features are   
   >> implemented, specifically whether code modification is required. I was   
   >> referring to features such as assigned goto in Fortran, and Alter goto   
   >> in Cobol.   
   >   
   > On modern architectures higher-order functions are implemented with   
   > indirect branches or indirect calls (depending on whether it's a   
   > tail-call or not); likewise for method dispatch.   
   >   
   > I do not know how Lisp, FORTRAN, Algol 60 and other early languages   
   > with higher-order functions were implemented on architectures that do   
   > not have indirect branches; but if the assigned goto was implemented   
   > with self-modifying code, the call to a function in a variable was   
   > probably implemented like that, too.   
      
   What architecture cannot do an indirect branch, which I assume   
   means a branch/jump to a variable location in a register?   
   And how would the operating system on such a machine get programs running?   
      
   Even if an ISA did not have a JMP reg instruction one can create it   
   using CALL to copy the IP to the stack where you modify it and   
   RET to pop the new IP value.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|