|
For the record, my SVN is /that/ out of sync with the main repository. =D This version of the patch also allows you to have duck-typed parameters by default, like in the test1 case below. //none of these work without the implicit duck typing option: def test2(): def test3(): print "test1:" Patch applied. Thanks! BTW, I renamed DuckByDefault to Ducky to make it consistent with the command line option. " The -ducky flag would be useful for the interactive shells, perhaps even more so." Yeah, Ducky is on by default for the interactive interpreter now. You can turn it off by typing "interpreter.Ducky = false" I updated the docs for the interpreter and duck typing options here: "Also, would it make sense to have a "ducky" attribute to turn on duckiness for a block?" Maybe that's something we can look into when we have a general "options" macro or attribute for specifying multiple options such as: |
||||||||||||||||||||||||||||||||||||||||||||
Three patches.
*Implement implict duck typing for all objects whose generic type is "object." This includes vague statements like "x as object" and when iterating through an Enumerable that returns an object.
*Implemeted booc.exe with a switch "-ducky" to toggle implicit duck typing behavior.
*Implemented "DuckByDefault" in CompilerParameters to make the two above patches work properly and nonintrusively.