Re: embedding languages in Perl 6

2005-04-21 Thread Michele Dondi
On Wed, 20 Apr 2005, [ISO-8859-2] BÁRTHÁZI András wrote: I'm just wondering, if the following would be possible with Perl 6 or not? XML $a=elemselemContent #1/elemelemContent #2/elem/elems; [snip] The ideas coming from Comega, the next version of CSharp(?). Here's an intro about it: Some time ago

embedding languages in Perl 6

2005-04-20 Thread BÁRTHÁZI András
Hi, I'm just wondering, if the following would be possible with Perl 6 or not? XML $a=elemselemContent #1/elemelemContent #2/elem/elems; say $a.elems[0].elem[1].content; # Content #1 for ($a.elems) { say $_.content; } or XPath like syntax on a structure? SQL $a=select * from table; for(select *

Re: embedding languages in Perl 6

2005-04-20 Thread Larry Wall
On Wed, Apr 20, 2005 at 05:08:51PM +0200, BÁRTHÁZI András wrote: : Hi, : : I'm just wondering, if the following would be possible with Perl 6 or not? : : XML : : $a=elemselemContent #1/elemelemContent #2/elem/elems; : : say $a.elems[0].elem[1].content; # Content #1 : : for ($a.elems) { say

Re: embedding languages in Perl 6

2005-04-20 Thread BÁRTHÁZI András
Hi, : I'm just wondering, if the following would be possible with Perl 6 or not? : : XML : : $a=elemselemContent #1/elemelemContent #2/elem/elems; : : say $a.elems[0].elem[1].content; # Content #1 : : for ($a.elems) { say $_.content; } : : or XPath like syntax on a structure? That's

Re: embedding languages in Perl 6

2005-04-20 Thread Larry Wall
On Wed, Apr 20, 2005 at 06:57:00PM +0200, BÁRTHÁZI András wrote: : It ends, when a non opened ')', a ';' or a '}' is coming. Of course, : that's not all cases, but it seems to be not so hard to find the all : possible cases. The question is what will be clear to the reader of the code. : We

Fwd: Re: embedding languages in Perl 6

2005-04-20 Thread Matt
I sent this to BÁRTHÁZI only instead of BÁRTHÁZI and the list as well. So here's a forward of what I sent and he replied to. --- Forwarded message --- From: Matt [EMAIL PROTECTED] To: BÁRTHÁZI András [EMAIL PROTECTED] Cc: Subject: Re: embedding languages in Perl 6 Date: Wed, 20 Apr

Re: Fwd: Re: embedding languages in Perl 6

2005-04-20 Thread Larry Wall
On Wed, Apr 20, 2005 at 01:51:11PM -0400, Matt wrote: : If not already possible, it would be neat to be able to define your own : quote blocks. Such as being able to define how to parse the below lines: : : $result = q:sql/SELECT * FROM table/; : : for q:sql/SELECT * FROM table WHERE

Re: Fwd: Re: embedding languages in Perl 6

2005-04-20 Thread Juerd
Matt skribis 2005-04-20 13:51 (-0400): If not already possible, it would be neat to be able to define your own quote blocks. Such as being able to define how to parse the below lines: It is possible to create your own sql// if you want it. for q:sql/SELECT * FROM table WHERE id=$id/ {

Re: Fwd: Re: embedding languages in Perl 6

2005-04-20 Thread BÁRTHÁZI András
Hi, What is the benefit of this syntax over having a simple function that takes one argument, interpolating variables from CALLER::? for sql 'SELECT * FROM table WHERE id=$id' { ... } The difference is between compile time parsing and runtime parsing. This expression can be transformed to a

Re: Fwd: Re: embedding languages in Perl 6

2005-04-20 Thread Matt
On Wed, 20 Apr 2005 14:13:42 -0400, Larry Wall [EMAIL PROTECTED] wrote: Heredocs are variants on q:toSQLPROC these days, but if you're going to be mixing Perl and SQL syntax, it's probably better to dispense with the heredoc and just have a language variant so that you can parse it at compile