Changes between Initial Version and Version 2 of Ticket #7111


Ignore:
Timestamp:
Oct 15, 2012 12:04:48 AM (3 years ago)
Author:
igloo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7111

    • Property Difficulty changed from to Unknown
  • Ticket #7111 – Description

    initial v2  
    55
    66imagine a keyword 'extends' in a data constructor that creates any boilerplate behind the scenes.
    7 
     7{{{
    88data Base = Base { slotA::Int32, slotB::Int32 }
    99data Foo = Foo extends Base { foo :: Int32 }
    1010data Bar = Bar extends Base { bar1 :: Float,bar2 ::Float }
    11 
     11}}}
    1212'slotA' is now always a function to extract the first element of a 2,3,4 element tuple
    1313'slotB' is now always a function to extract the second element of a 2,3,4 element tuple
     
    1616 
    1717by analogy with c++,
     18{{{
    1819struct Base {
    1920  int32 slotA,int32 slotB;
     
    3435 //  'a' corresponds to a ptr offset of 0, for all types
    3536//   'b' corresponds to a ptr offset of 4 for all types
    36 
     37}}}
    3738By analogy to  assembly-language:-
    38 
     39{{{
    3940; declare 'Base' datsstructure elements
    4041RSRESET         ;clear structure offset counter
     
    5758;slotA=0, slotB=4, foo=8,  bar1=8, bar2=12
    5859; baseSize=0;  fooSize=12;   barSize=16
     60}}}