Blog Stats
  • Posts - 62
  • Articles - 11
  • Comments - 114
  • Trackbacks - 63

 

My beef with XEN

Everytime I see something like this it makes me puke:

public class Test {
    static void Main() {
        card c = <card>
                   <name>John Doe</name>
                   <title>CEO, Widget Inc.</title>
                   <email>john.doe@widget.com</email>
                   <phone>(202) 456-1414</phone>
                   <logo url="widget.gif"/>
                 </card>;
        c.*.{ Console.WriteLine(it); };
    }
}

The use of xml should be relegated to the boundaries of the domain (receive/transmit), it is senseless to try to incorporate it into the language.

I consider more important the implementation of object initializers a la javascript with a C# flavor:

card c = card{
           name="John Doe";
           title="CEO, Widget Inc.";
           email="john.doe@widget.com";
           phone="(202) 456-1414";
           logo{@url="widget.gif"};
         };

Of course, determining the right syntax for attributes and objects with values would be the challenge.

Trying to represent this with a stream can be cumbersome:

<a href='anypage.com'>click here</a>

With the new 'attribute' keyword we have the attributes impedance solved, now what to do with the content? This could be a solution, not that I like it but:

link l = a{ 
            @href='anypage.com'; // attributes
            #value='click here'; // only one #value allowed
          }

so, to complete the schema definition we should have:

public class a {
    attribute string href;
    string this;
}

then these would be valid statements:

a@href = 'anypage.com'; // attribute
a#value = 'click me';   // or
a = 'click me'; // since the assignment will go to the #value element

Now XEN looks much more appealing, don't you think?


Feedback

# re: My beef with XEN

Gravatar who is zen and why is it wasting my time 4/20/2004 8:23 PM | xen is a hen ha haha give up the

Post a comment





 

Please add 2 and 8 and type the answer here:

 

 

Copyright © RebelGeekz