Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Simplifying the syntax furtherby tmoertel (Chaplain) |
on Nov 21, 2005 at 21:15 UTC ( [id://510563]=note: print w/replies, xml ) | Need Help?? |
To further reduce the syntax burden, we can eliminate many calls to
the text constructor by letting element constructors accept
an optional third argument for text content. In the common case, we
no longer have need to call text. (Of course, should we want
to call text for clarity, we still can.)
For example, the following fragment: can be simplified to this:
To effect the new syntax rules, we need only change the _elem and define_vocabulary functions from our original implementation. The changes are simple and marked with a hash-bang (#!):
Can you spot any other syntax-reduction opportunities? Cheers, Tom Moertel : Blog / Talks / CPAN / LectroTest / PXSL / Coffee / Movie Rating Decoder
In Section
Meditations
|
|