Changeset 19337 for ext

Show
Ignore:
Timestamp:
01/05/08 08:38:40 (12 months ago)
Author:
Darren_Duncan
Message:

ext/Muldis-DB/ : in Value.pm, demoted Order type from generic to catalog-specific

Location:
ext/Muldis-DB
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • ext/Muldis-DB/TODO

    r17897 r19337  
    3535* Update the Example Engine to implement the rest of the relational 
    3636algebra|calculus operators, as well as all the reasonable operators for 
    37 other core data types: Bool, Order, Int, Num, Blob, Text. 
     37other core data types: Bool, Int, Rat, Blob, Text. 
    3838 
    3939* Update the Example Engine to implement persisting databases.  For 
  • ext/Muldis-DB/lib/Muldis/DB/Engine/Example/Value.pm

    r19333 r19337  
    77my Bool $BOOL_TRUE  = Bool::True; 
    88 
    9 my Order $ORDER_INCREASE = (1 <=> 2); 
    10 my Order $ORDER_SAME     = (1 <=> 1); 
    11 my Order $ORDER_DECREASE = (2 <=> 1); 
     9my Order $CAT_ORDER_INCREASE = (1 <=> 2); 
     10my Order $CAT_ORDER_SAME     = (1 <=> 1); 
     11my Order $CAT_ORDER_DECREASE = (2 <=> 1); 
    1212 
    1313my Str $EMPTY_STR = q{}; 
     
    2424        (Bool :$v!) is export { 
    2525    return ::Muldis::DB::Engine::Example::Value::Bool.new( :v($v) ); 
    26 } 
    27  
    28 sub newOrder of Muldis::DB::Engine::Example::Value::Order 
    29         (Order :$v!) is export { 
    30     return ::Muldis::DB::Engine::Example::Value::Order.new( :v($v) ); 
    3126} 
    3227 
     
    7166    return ::Muldis::DB::Engine::Example::Value::Relation.new( 
    7267        :heading($heading), :body($body) ); 
     68} 
     69 
     70sub newCat_Order of Muldis::DB::Engine::Example::Value::Cat_Order 
     71        (Order :$v!) is export { 
     72    return ::Muldis::DB::Engine::Example::Value::Cat_Order.new( :v($v) ); 
    7373} 
    7474 
     
    202202 
    203203} # class Muldis::DB::Engine::Example::Value::Bool 
    204  
    205 ########################################################################### 
    206 ########################################################################### 
    207  
    208 class Muldis::DB::Engine::Example::Value::Order { 
    209     does Muldis::DB::Engine::Example::Value::Scalar; 
    210  
    211     has Order $!v; 
    212  
    213 ########################################################################### 
    214  
    215 submethod BUILD (Order :$v!) { 
    216     $!v = $v; 
    217     return; 
    218 } 
    219  
    220 ########################################################################### 
    221  
    222 method _root_type of Str () { 
    223     return 'sys.Core.Order.Order'; 
    224 } 
    225  
    226 method _which of Str () { 
    227     return ~$!v; 
    228 } 
    229  
    230 ########################################################################### 
    231  
    232 method _is_equal of Order (::T $self: T $other!) { 
    233     return $other!v === $self!v; 
    234 } 
    235  
    236 ########################################################################### 
    237  
    238 method v of Order () { 
    239     return $!v; 
    240 } 
    241  
    242 ########################################################################### 
    243  
    244 } # class Muldis::DB::Engine::Example::Value::Order 
    245204 
    246205########################################################################### 
     
    579538########################################################################### 
    580539 
     540class Muldis::DB::Engine::Example::Value::Cat_Order { 
     541    does Muldis::DB::Engine::Example::Value::Scalar; 
     542 
     543    has Order $!v; 
     544 
     545########################################################################### 
     546 
     547submethod BUILD (Order :$v!) { 
     548    $!v = $v; 
     549    return; 
     550} 
     551 
     552########################################################################### 
     553 
     554method _root_type of Str () { 
     555    return 'sys.Core.Cat.Order'; 
     556} 
     557 
     558method _which of Str () { 
     559    return ~$!v; 
     560} 
     561 
     562########################################################################### 
     563 
     564method _is_equal of Bool (::T $self: T $other!) { 
     565    return $other!v === $self!v; 
     566} 
     567 
     568########################################################################### 
     569 
     570method v of Order () { 
     571    return $!v; 
     572} 
     573 
     574########################################################################### 
     575 
     576} # class Muldis::DB::Engine::Example::Value::Cat_Order 
     577 
     578########################################################################### 
     579########################################################################### 
     580 
    581581=pod 
    582582 
     
    606606 
    607607Specifically, this file represents the core system-defined data types that 
    608 all Muldis D implementations must have, namely: Bool, Order, Int, Rat, 
    609 Blob, Text, Tuple, Relation, QuasiTuple, QuasiRelation, and the Cat.* 
    610 types. 
     608all Muldis D implementations must have, namely: Bool, Int, Rat, Blob, Text, 
     609Tuple, Relation, QuasiTuple, QuasiRelation, and the Cat.* types. 
    611610 
    612611By contrast, the optional data types are given physical representations by