- Timestamp:
- 10/01/07 06:02:24 (16 months ago)
- Location:
- ext/Muldis-DB
- Files:
-
- 4 modified
-
Changes (modified) (1 diff)
-
lib/Muldis/DB/Engine/Example.pm (modified) (5 diffs)
-
lib/Muldis/DB/Interface.pm (modified) (7 diffs)
-
lib/Muldis/DB/Validator.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ext/Muldis-DB/Changes
r18105 r18252 2 2 --------------------------------------------------------------------------- 3 3 4 2007- 09-22Darren Duncan <perl@DarrenDuncan.net>5 6 * Muldis DB version 0. 4.0 for Perl 5 is released on CPAN as7 Muldis-DB-0. 4.0.tar.gz. Muldis DB version 0.4.0 for Perl 6 is not4 2007-10-xx Darren Duncan <perl@DarrenDuncan.net> 5 6 * Muldis DB version 0.5.0 for Perl 5 is released on CPAN as 7 Muldis-DB-0.5.0.tar.gz. Muldis DB version 0.5.0 for Perl 6 is not 8 8 released at this time, if ever, since it is currently released only as 9 9 part of the Perl6-Pugs project (in its ext/Muldis-DB/ subdirectory), 10 10 which sets its own less frequent release schedule. The rest of this 11 11 Changes entry refers only to the Perl 5 version. 12 13 * New file versions are: DB.pm and Interface.pm and Validator.pm and 14 Example.pm 0.5.0. The other pre-existing versioned files are 15 unchanged. 16 17 * (Interface.pm, Example.pm, Validator.pm) Added a new attribute to 18 the DBMS role (and Example's doing class), "expected AST language", 19 with which Muldis DB users explicitly declare what Muldis DB (or 20 alternative) language version they expect to use for further 21 interaction with that DBMS. The new_dbms constructor function gains a 22 parameter ('exp_ast_lang') for setting its default value, and the DBMS 23 role gains 2 methods for fetching/updating that attribute. Note that, 24 unlike the engine_name and dbms_config parameters, exp_ast_lang is 25 generally not suited to read from a config file, as it is meant to 26 correspond to program code rather than a user's runtime setting. The 27 &main of Validator.pm was updated to provide a hard-coded argument for 28 exp_ast_lang, which will be maintained in future releases at the latest 29 official Muldis D version number known to work at the time. 30 31 2007-09-22 Darren Duncan <perl@DarrenDuncan.net> 32 33 * Muldis DB version 0.4.0 for Perl 5 is released on CPAN as 34 Muldis-DB-0.4.0.tar.gz. Muldis DB version 0.4.0 for Perl 6 is not 35 released at all. The rest of this Changes entry refers only to the 36 Perl 5 version. 12 37 13 38 * This release is a snapshot to show a particular mid-way point in a -
ext/Muldis-DB/lib/Muldis/DB/Engine/Example.pm
r18105 r18252 13 13 14 14 sub new_dbms of Muldis::DB::Engine::Example::Public::DBMS 15 (A ny :$dbms_config!) {15 (Array :$exp_ast_lang!, Any :$dbms_config!) { 16 16 return ::Muldis::DB::Engine::Example::Public::DBMS.new( 17 : dbms_config($dbms_config) );17 :exp_ast_lang($exp_ast_lang), :dbms_config($dbms_config) ); 18 18 } 19 19 … … 36 36 # For the moment, the Example Engine doesn't actually have anything 37 37 # that can be configured in this way, so input $dbms_config is ignored. 38 has Any $!exp_ast_lang; 38 39 has Any $!dbms_config; 39 40 … … 51 52 ########################################################################### 52 53 53 submethod BUILD (Any :$dbms_config!) { 54 55 $!dbms_config = $dbms_config; 54 submethod BUILD (Array :$exp_ast_lang!, Any :$dbms_config!) { 55 56 # TODO: input checks. 57 $!exp_ast_lang = [$exp_ast_lang.values]; 58 $!dbms_config = $dbms_config; 56 59 57 60 $!assoc_vars = {}; … … 67 70 # TODO: check for active trans and rollback ... or member VM does it. 68 71 # Likewise with closing open files or whatever. 72 return; 73 } 74 75 ########################################################################### 76 77 method fetch_exp_ast_lang of Array () { 78 return [$!exp_ast_lang.values]; 79 } 80 81 method store_exp_ast_lang (Array :$lang!) { 82 # TODO: input checks. 83 $!exp_ast_lang = [$lang.values]; 69 84 return; 70 85 } … … 210 225 # return $!var.as_phmd(); # TODO; or some such 211 226 } 212 213 ###########################################################################214 227 215 228 method store_ast (Array :$ast!) { -
ext/Muldis-DB/lib/Muldis/DB/Interface.pm
r18105 r18252 10 10 11 11 sub new_dbms of Muldis::DB::Interface::DBMS 12 (Str :$engine_name!, A ny :$dbms_config!) {12 (Str :$engine_name!, Array :$exp_ast_lang!, Any :$dbms_config!) { 13 13 14 14 die q{new_dbms(): Bad :$engine_name arg; it is not an object of a} … … 37 37 my $dbms = undef; 38 38 try { 39 $dbms = &::($engine_name)::new_dbms( :dbms_config($dbms_config) ); 39 $dbms = &::($engine_name)::new_dbms( 40 :exp_ast_lang($exp_ast_lang), :dbms_config($dbms_config) ); 40 41 }; 41 42 if (my $err = $!) { … … 60 61 role Muldis::DB::Interface::DBMS { 61 62 63 method fetch_exp_ast_lang { 64 die q{not implemented by subclass } ~ self.WHAT; 65 } 66 67 method store_exp_ast_lang { 68 die q{not implemented by subclass } ~ self.WHAT; 69 } 70 62 71 method new_var { 63 72 die q{not implemented by subclass } ~ self.WHAT; … … 242 251 my $dbms = Muldis::DB::Interface::new_dbms( 243 252 :engine_name('Muldis::DB::Engine::Example'), 253 :exp_ast_lang([ 'MuldisD', 'cpan:DUNCAND', '0.8.1' ]), 244 254 :dbms_config({}), 245 255 ); … … 345 355 =over 346 356 347 =item C<new_dbms of Muldis::DB::Interface::DBMS (Str :$engine_name!, A ny348 :$ dbms_config!)>357 =item C<new_dbms of Muldis::DB::Interface::DBMS (Str :$engine_name!, Array 358 :$exp_ast_lang!, Any :$dbms_config!)> 349 359 350 360 This constructor function creates and returns a C<DBMS> object that is … … 358 368 role. This function will start by testing if the root package is already 359 369 loaded (it may be declared by some already-loaded file of another name), 360 and only if not, will it do a Perl 'require' of the C<$engine_name>. 370 and only if not, will it do a Perl 'require' of the C<$engine_name>. The 371 new C<DBMS> object's "expected AST language" attribute is initialized from 372 the C<$exp_ast_lang> argument, which is a 3-element Array as described for 373 the argument of the C<DBMS> method C<store_exp_ast_lang> (if applicable, 374 the C<$dbms_config> argument is interpreted in light of C<$exp_ast_lang>). 361 375 362 376 =back … … 374 388 375 389 =over 390 391 =item C<fetch_exp_ast_lang of Array ()> 392 393 This method returns, as a 3-element (ordered) Array, the long name of the 394 Muldis D (or alternative) language version that its invocant C<DBMS> object 395 and its associated/child objects expect their AST/code/value input to 396 conform to, and that their AST/code/value output will conform to. The 3 397 elements of the array (each a Str) are, in order, the language spec base 398 name (typically C<MuldisD>), the language spec authority (typically 399 C<cpan:DUNCAND> when the base name is C<MuldisD>), and the language spec 400 version number (looks like C<1.2.3> for C<MuldisD> plus C<cpan:DUNCAND>). 401 402 =item C<store_exp_ast_lang (Array :$lang!)> 403 404 This method assigns a new expected language long name to its invocant 405 C<DBMS>, which is supplied in the C<$lang> argument; the argument is 406 expected to be a 3-element Array as described for C<fetch_exp_ast_lang>. 407 This method dies if the specified language/version isn't one that the 408 invocant's Engine knows how to or desires to handle. 376 409 377 410 =item C<new_var of Muldis::DB::Interface::Var (Str :$decl_type!)> -
ext/Muldis-DB/lib/Muldis/DB/Validator.pm
r18105 r18252 20 20 # Instantiate a Muldis DB DBMS / virtual machine. 21 21 my Muldis::DB::Interface::DBMS $dbms = Muldis::DB::Interface::new_dbms( 22 :engine_name($engine_name), :dbms_config($dbms_config) ); 22 :engine_name($engine_name), 23 :exp_ast_lang([ 'MuldisD', 'cpan:DUNCAND', '0.8.1' ]), 24 :dbms_config($dbms_config), 25 ); 23 26 does_ok( $dbms, 'Muldis::DB::Interface::DBMS' ); 24 27
