Changes between Version 2 and Version 3 of TypeDirectedNameResolution


Ignore:
Timestamp:
Jul 17, 2009 10:59:59 AM (6 years ago)
Author:
simonmar@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TypeDirectedNameResolution

    v2 v3  
    8282The basic design is simple:
    8383
     84 * There is a new lexeme, of the form `'.' varid`, which we call `dot_var`.
     85   The part after the dot a simple unqualified name (not a qualified name).
     86
    8487 * Extend the syntax of atoms:
    8588{{{
     
    8790      |  var_unqual            -- Unqualified variable name
    8891      |  '(' expr ')'          -- Parenthesised expression
    89       |  atom '.' var_unqual   -- TDNR invocation
    90 }}}
    91   The part after the dot a simple unqualified name (not a qualified name). 
     92      |  atom dot_var          -- TDNR invocation
     93}}}
    9294  For example, `a`, `a.f` and `a.f.g` are atoms.
    9395
     
    238240propose ''not'' to apply it to record update, a construct that is already
    239241rather complicated to typecheck.  I do not want to make it worse.
     242
     243== section-style selection ==
     244
     245We have the option to allow '(.x)' as a valid expression, with its meaning given by the translation
     246
     247{{{
     248  (.x)  ===  (\f -> f.x)
     249}}}
     250
     251This allows things like
     252
     253{{{
     254  map (.x) rs
     255}}}
     256
     257and means that `(.x) f` is equivalent to `f.x`.  The syntax and meaning is consistent with right-section, although it is not really a right-section.
     258
     259What about `(.x.y)`?  Does that expand to `(\f -> f.x.y)`?