This illustrates a couple of principles when writing your DSL. First, I like to isolate DSL-based code inside a function. This allows cleaner separation from the rest of your program, so you can write helper functions inside the DSL function and not have them polute the global namespace. Second, you should write some test code first: it will make writing the DSL implementation much easier.
For this example I’m going to be writing a simple permissions language that sets up rules about when certain methods may be called. It could be applied to a system for playing monopoly:
Read More...
|
Rate this Ajax Articles
Error connecting to mysql |
|