Activate your free membership today | Log-in

Friday, March 28th, 2008

Composing DSLs in JavaScript

Category: Articles, JavaScript

>PLAIN TEXT
JAVASCRIPT:
  1.  
  2. TheRulesAre(function() { with(this) {
  3.  
  4.     a(Player).mayNot('buyProperty').unless(function(player, property) {
  5.         return property.owner === null &&
  6.                 player.funds>= property.price;
  7.     });
  8.  
  9.     a(Property).mayNot('addHouse').when(it().isMortgaged());
  10. }});
  11.  

Composing DSLs in JavaScript is James Coglan's latest perusal into fun with JavaScript and DSLs.

He walks through the building of this DSL in a step by step manner. He uses his JS.Class library, but you could of course substitute your favourite JavaScript library.

Related Content:

  • A trick for closing JavaScript windows
    This tip describes a procedure for closing JavaScript...
  • FAQ: Lotus Notes, Domino and JavaScript
    Caught in a JavaScript jam? Before posing a question to our SearchDomino.com experts, check out our list of frequently asked questions on JavaScript...
  • Diet Ajax, 100% JavaScript free
    The open source Ajax framework ZK 1.0 has been released with its own markup language along with XUL and XHTML components to get around programming in...
  • Microsoft works on Ajax JavaScript tools
    In a session at the recent Ajax Experience conference in San Francisco, Matt Gibbs, development manager in the UI Framework and Services team at...
  • Junk JavaScript?
    Should JavaScript and HTML be replaced with "proper" languages that might give more bang for the buck in rich Internet applications (RIAs)? One reader...

Posted by Dion Almaer at 7:27 am
1 Comment

++++-
4 rating from 8 votes

1 Comment »

Comments feed TrackBack URI

Apparently it’s Domain Specific Language (http://ajaxian.com/archives/metaprogramming-dsl-javascript-presentation) rather than Dual Super Lead, or Digital Subscriber Line etc etc

Comment by Dave Crighton — March 28, 2008

Leave a comment

You must be logged in to post a comment.