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

embedding languages in Perl 6

Thread Next
April 20, 2005 08:08
embedding languages in Perl 6
Message ID:

I'm just wondering, if the following would be possible with Perl 6 or not?

 > XML

$a=<elems><elem>Content #1</elem><elem>Content #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 * from table where id>5) {
   say $ ~ ' -> ' $_.value;

The ideas coming from Comega, the next version of CSharp(?). Here's an 
intro about it:

Or just search for "comega" with you favourite search engine.

The first one, creating native XML support for a language is not new, 
E4X (EcmaScript for XML) is about the same:

I think both about macros, and it seem's it will be possible extend Perl 
6 with them. But what do you think about extending Perl 6 (or Perl 6.1) 
with native XML handling, like it's native regular expression / rule 


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About