Hi Matt,
Why didn't you sent it to the list, too?
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; }
Yes, my example was both possible to do with macros, as I think. But currently I can do this, too:
$a=sql('select * from table');
And it's almost the same... The differnce:
sql<select * from table where id=$id>
And it can mean:
prepare('select * from table where id=?') do($id);
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.
Huh. That's not exactly what I'm dreaming about. ;) My dream is about a compact notation with compact functions with a lot of possibility.
Bye, Andras