develooper Front page | perl.perl6.language | Postings from April 2005

Fwd: Re: embedding languages in Perl 6

Thread Previous | Thread Next
From:
Matt
Date:
April 20, 2005 10:51
Subject:
Fwd: Re: embedding languages in Perl 6
Message ID:
op.spjk7lk48hsiyb@codeslut
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 <matt@weakmind.org>
To: "BÁRTHÁZI András" <andras@barthazi.hu>
Cc:
Subject: Re: embedding languages in Perl 6
Date: Wed, 20 Apr 2005 13:12:43 -0400

On Wed, 20 Apr 2005 12:57:00 -0400, BÁRTHÁZI András <andras@barthazi.hu>
wrote:

>
> It would be nicer to say:
>
> $a=xml<elems><elem>Content #1</elem><elem>Content #2</elem></elems>;
>
> But native xml parsing is better, I think. :)
>
> Anyway, it's possible to write:
>
> $a=sql<select * from table>;
>

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 id=$id/ {
		say $_.id ~ ' -> ' ~ $_.value;
	}

Or someone could write a module for P6SQL ? (Pardon me for not remembering
exactly how HEREDOCs work in P6)

	p6sql_query "SQLPROC">>

	$result = SELECT * FROM table
	FOREACH ROW IN $result AS $field
		SAY $field.id " -> " $field.value
	END FOREACH

	SQLPROC

Or maybe I'm getting a bit too crazy.



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About