[Dbix-class] fyi, official terse Muldis D dialect for daily work

Darren Duncan darren at DarrenDuncan.net
Mon Jan 14 21:53:13 GMT 2008


At 7:49 AM +0000 1/14/08, Matt S Trout wrote:
>Uint function square (Int topic) {
>   Int.power (topic, Int 2);
>}
>
>That's terse. Yours is not. So far as I can tell mine is pretty much
>equivalent. With a bit of perl optree parsing (and Devel::Declare) you
>could perl-host this as
>
>Uint function square (Int $topic) {
>   Int->power($topic, Int 2);
>};
>
>which isn't quite as elegant but is definitely parseable :)
>
>Food for thought, anyway.

Now I suspect this is what you may be saying, but it would be 
important to me that a tightly Perl-integrated solution like this 
would work without the use of a source filter; any Muldis D code 
written this way should be entirely parseable by the vanilla Perl 
parser; make any adjustments to the above needed to do that.

I suspect that perhaps :tags could be used for meta-data, or perhaps 
what Moose does?

In fact, I designed Muldis D such that everything in it could be 
directly expressed using native Perl 5 idioms, plus some meta-data 
tagging and a few new classes.  (And in Perl 6 it is even more 
direct.)

For example, the Relation.restriction function takes a list-like 
Relation value plus a closure-like function as input, and is the same 
as Perl's "grep { $func->($_) } @$relation", doing what SQL's "select 
* from relation where func-body" does.

So I would be happy to see this sort of thing happen, but I currently 
lack the Perl optree et al tuits to do it myself, though will help 
anyone else to do it.

-- Darren Duncan



More information about the DBIx-Class mailing list