From: Matthew P F. <mpf...@th...> - 2003-07-22 10:50:29
|
I've just checked in whole bunch of new code, more or less a complete rewrite. I plan on updating the documentation sometime this week, then we'll do a 0.1.0 release. The main differences between this version and the last are: * No more ant integration. Need to revisit this, see if it's something we still want to do. Ideally writing tasks in pynt will be a lot easier than in ant (if not we need to change pynt), so it might be worth just writing new versions of the most common tasks. * No more python style indentation syntax (too controversial). Blocks now end with an "end" statement. * Added a "export" keyword to indicate which methods/fields should be imported by other pynt files. I've also switched the "load" and "import" keywords, so that you now use "import" to import other pynt files, and "load" to load java classes. * Can no longer embed variables into strings (ie "my name is {name}"). Need to revisit this. * The pipe syntax is gone for scanning for files - use the Scan method in files.pynt instead (which is not as clean, i admit) * Slight changes to the "load" syntax * Removed new() method to create a new pynt object, but added a "this" keyword that can be used to return the current stack frame. * Started using upper case for the first letter of method names, to avoid collisions See the pynt.pynt file for an example of a lot of these changes ___ Short term issues: * Better syntax for creating PyntFiles * Sort out collection types (need an easy way to handle paths, filesets, etc) * Reassigning a value to a variable should fail * Tests * A lot of other things i can't think of right now ___ Long term issues: * Syntax for regular expressions and xml ___ Possible changes: * I'm considering removing the need for parenthesis on method calls. This would make methods behave more like our built in functions (and indeed, things like "print" and "show" could be implemented as pynt functions, not built in constructs). So for example, instead of writing: Javac(files=myfiles,output="dest") You would just write: Javac files=myfiles output=dest Which I think is cleaner when typing things at the interactive prompt. However, you would no longer be obvious whether you were calling a method or a target (do we care?) * A bigger change i'm considering would be to make *every* expression evaluated in a lazy way, not just targets. This would make pynt similar to a lot of functional languages with lazy evaluation (ie Haskell). The benefit is that developers won't need to define explicit targets. The downside is that it can seem a bit counter-intuitive at times. How it works is that whenever you see an assignment in pynt, the value on the right will *not* be evaluated until the value on the left is used. For example: > foo = print "10" # produces no output > foo # now evaluates "print 10" 10 This basically eliminates the need for "target" and "build" expressions. You could just have: javac = Javac classpath=myclasspath ... jar = Jar files=(Scan javac.output)... test = classpath=javac.classpath... Then from the command line, typing "jar" would cause the "Jar files=..." expression to be evaluated, and the "javac.output" expression will cause "Javac classpath-..." to be evaluated. But the "test" line will not be evaluated. Looks promising, but need to try it out on larger build files to see how it works. ___ Thoughts? Matt Foemmel ThoughtWorks, Inc. |