Changes between Version 58 and Version 59 of ExplicitCallStack


Ignore:
Timestamp:
Feb 1, 2007 1:24:14 PM (7 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExplicitCallStack

    v58 v59  
    279279=== Transformation option 1 === 
    280280 
    281 This is probably the simplest transformation style possible. Stack traces are passed to (let bound) functions at their lexical call sites, which correspond to the places where the function is mentioned in the source code. CAF bindings are treated as roots of stacks, so only function bindings receive stack arguments. In this transformation we can get away with simply passing one stack argument for each function, regardless of how many regular arguments it has. In contrast, other transformation styles 
     281This is probably the simplest transformation style possible. Stack traces are passed to (let bound) functions at their lexical call sites, which correspond to the places where the function is mentioned in the source code. Pattern bindings are treated as roots of stacks, so only function bindings receive stack arguments. In this transformation we can get away with simply passing one stack argument for each function, regardless of how many regular arguments it has. In contrast, other transformation styles 
    282282might pass one stack argument for every regular argument of the function. 
    283283 
     
    318318}}} 
    319319 
    320 In the above rules a variable is function bound, if it is defined in the form `x = \y1 .. y n -> E`. In other words it 
    321 is a syntactic property of the way the variable is defined, rather than a type property. 
     320In the above rules a variable is function bound, if it is defined in the form "`x = \y1 .. y n -> E`". In other words it 
     321is a syntactic property of the way the variable is defined, rather than a type property. In contrast, a variable is pattern bound if it is defined in the form "`x = E`", where `E` is ''not'' a lambda abstraction. 
    322322 
    323323An advantage of this transformation style is that it handles combinations of transformed and untransformed functions easily. When variable expressions are transformed we simply check to see if the variable corresponds to a transformed function. If it does, we pass it the current stack value as an argument, otherwise we don't. 
     
    375375}}} 
    376376 
    377 Notice that in the first case the stack passed to `head` and `foo` is simply `["f1"]`, but in the second case it is `"f2":t`. One ''might'' expect the same stack trace to be generated for each declaration. 
     377Notice that in the first case the stack passed to `head` and `foo` is simply `["f1"]`, but in the second case it is `"f2":t`. One ''might'' expect the same stack trace to be generated for each declaration. This might be particularly annoying/confusing in cases where people use a point free style of programming. Consider these two definitions: 
     378 
     379{{{ 
     380   g1 = foo . bar . goo 
     381 
     382   g2 = \x -> foo (bar (goo x) 
     383}}}