On 3/16/07, Darren Duncan wrote:
On Wed, 7 Mar 2007, Smylers wrote:
>[...]
Perl is a better language than SQL, in general, [...]
Likewise, we shouldn't have to write in SQL, or in pseudo-Perl-SQL,
but just write in Perl.
A database is supposed to be a base for *data*, after all. I'd love
to be able to do all the coding in native Perl.
All this said, I recognize that a lot of details can be provided in
a Perl 6 module rather than being in the core language
specification, and maybe that very well may be the best option. But
I still can't help feeling that some of this naturally fits in the
core language as much as Perl 6's replacement for PDL does.
I'm not really that concerned about what's "CORE(TM)" or not; P6
minimises the distinction between them, and CP6AN will make it even
less worth worrying about. Perhaps the most salient point is how
well some proposed syntax would play with normal, "core" syntax. And
that seems a most suitable thing to discuss in p6-*language* --
modules need a language, so we can discuss what makes good syntax for
them too. (We've all seen modules that, while useful, don't feel
very perlish (which in P5 is admittedly often a result of limitations
in how much you can warp the language to your own ends).)
> DBI is a module, not a core part of the Perl language. I think it would
be odd for Perl 6 to have core support for these operations when most
> users would use DBI instead.
<shrug> Maybe if it were built-in, a lot more people might discover
they have a use for the new way... at any rate, it's a moot point
until someone actually produces some code. In the meantime, Darren's
proposal still raises a lot of interesting language questions.
For example, how *do* you rename a hash key? (That doesn't seem like
such a strange or unlikely need.) It's not something you'd use every
day, but then again I can't remember the last time I renamed files in
Perl. If we get a "rename" method for hashes, should it be called
something else? Or should file-renaming be called something else?
Or should both 'rename's be methods only, and not have any "rename"
function/multi? [I think that might already be the case, although I
can't put my finger on it at the moment.] ...
-David