You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2020/06/10 21:52:00 UTC

[GitHub] [incubator-daffodil] mbeckerle commented on pull request #385: Fix initiatedContent="yes" with empty initiator

mbeckerle commented on pull request #385:
URL: https://github.com/apache/incubator-daffodil/pull/385#issuecomment-642286754


   Many of the idioms we're using in Daffodil (in the schema compiler part anyway) are functional programming based. Lazy evaluation with value capture is essential to get linear behavior. Changing lazy vals to def can cause an exponential growth in computation simply recomputing the same thing multiple times (when that recomputation is happening in a recursive nest). So the rule of thumb is use def for abstract methods or methods with arguments or constants. Use lazy val everywhere else, and nothing can use side-effect or order-of-evaluation dependent computations. This of course applies to the schema compiler. Once we get to the runtime engine, imperative java-style code is the rule, and lazy evaluation and functional programming idoms like map/reduce/fold/loop-comprehensions are pretty much not used at all. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org