RE: [Zope] Use of lambda expression in DTML
Chris McDonough ponders: |> Your method, in particular, is worse to understand than my |> one-liner, specially for anyone who uses functional programming |> seriously; but even other people would have to reason for a |> few minutes to understand what you're appending to that poor |> list and why. | |I can see that argument... it depends on the reader, I suppose. I |wouldn't complain much actually if the Python code had functional stuff |in it. It's having it in DTML that bugs me, for reasons that |have to do |with separating HTML-like stuff from the stuff that actually runs the |site under the hood. I take your point, but it's making an assumption that map, filter, and lambda are going to be used for business logic. In my case (see original topic) would you argue that what I'm trying to do is business logic or presentation? As for HTML-like stuff vs. business stuff wrt to functional expressions: Do you object to CSS, XSLT, and XPath? I think I can see why the ZoPerl discussion is so vociferous... ;¬] Cheers, Nick Drew HyperSpace Ltd,Birmingham Research Park, Edgbaston, UK, B15 2SQ (e) hyperspace@btinternet.com (t) +44 (0)121 414 7019
Nick Drew wrote:
|I can see that argument... it depends on the reader, I suppose. I |wouldn't complain much actually if the Python code had functional stuff |in it. It's having it in DTML that bugs me, for reasons that |have to do |with separating HTML-like stuff from the stuff that actually runs the |site under the hood.
I take your point, but it's making an assumption that map, filter, and lambda are going to > be used for business logic. In my case (see original topic) would you argue that what I'm > trying to do is business logic or presentation?
Many apologies, I caught the thread at the tail and didn't look back to see the origin of the topic. This is pretty stupid on my part. I would say that you were indeed trying to do presentation logic. And furthermore, I would say that my arguments were offbase and pretty much knee-jerk reactions to the possibility of what might happen if functional kw's and builtins were added to DTML. After considering it further, it doesn't seem to be such a bad idea if it didn't impact security in any way. It might even reduce the complexity of DTML looping, which would be a good thing. It would most certainly be welcome in Python methods, I'd definitely miss map a lot in Python methods if it wasnt there. If it's something you want badly (and if you haven't already) add it as a feature request to the Collector on Zope.org. Once other folks get past the knee-jerk reaction, maybe it'll sink in as a good thing. In the meantime, you can add it yourself if you like. Hopefully, you'll be so kind as to forgive me. After seeing people post DTML code to the list that they need debugged that computes pay rates, has the shape of an arrowhead and scrolls past the maximum character length of my email client horizontally, I'm a little leery of adding anything whatsoever to DTML, as I think the rest of the folks at DC are. Reducing the complexity of DTML is a good thing, however it can be accomplished.
As for HTML-like stuff vs. business stuff wrt to functional expressions: Do you object to CSS, XSLT, and XPath?
I can't object to XSLT and XPath, I don't even know enough about them to spell them right. :-) CSS is all about presentation, but AFAICT doesn't have an expression syntax, nor even a way to spell a loop.
I think I can see why the ZoPerl discussion is so vociferous... ;¬]
I'm not sure I see the connection...
participants (2)
-
Chris McDonough -
Nick Drew