tag:blogger.com,1999:blog-29871611.post6820512123684321011..comments2015-07-24T12:03:30.908-04:00Comments on Side Notes: Flexible languageAndrey Paramonovhttp://www.blogger.com/profile/14375033587137190103noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-29871611.post-29205471867210240562012-12-08T15:55:55.308-05:002012-12-08T15:55:55.308-05:00Very nice. Very nice. Baljeethttps://www.blogger.com/profile/16313853259768522904noreply@blogger.comtag:blogger.com,1999:blog-29871611.post-21942206505781215772012-11-27T00:24:48.583-05:002012-11-27T00:24:48.583-05:00The handle() method is just an external contract, ...The handle() method is just an external contract, which is carried trough... Anyways, you can't really compare strongly-typed language with dynamically typed one.Eugene Kuleshovhttps://www.blogger.com/profile/08736056465101896635noreply@blogger.comtag:blogger.com,1999:blog-29871611.post-18129137410424196722012-11-26T23:56:50.275-05:002012-11-26T23:56:50.275-05:00Thanks Eugene for your example. Indeed you separat...Thanks Eugene for your example. Indeed you separated if- logic from handling logic, which makes your example better than my Java code above, but I think my Summary about Lisp expressiveness is still valid. Look at the signature of onHandle() methods. First, it's enforced by handle() method which is responsible for if- logic, so in a way if- logic leaks into handling logic. Second, all Handlers are coupled with message representation (i.e. map), which creates a small code duplication in every onHandle() implementation where you have to extract the data from the map. <br /><br />Lisp code, on the other hand, does not have these limitations. (handler …) calls are completely unaware of message representation. Theoretically, I can copy some existing function definition, rename parameters accordingly, and paste it inside (build-handlers …) body. This will automatically transform the function into a message handler. I don't think we can achieve this level of flexibility in Java.Andrey Paramonovhttps://www.blogger.com/profile/14375033587137190103noreply@blogger.comtag:blogger.com,1999:blog-29871611.post-27351129417444199782012-11-26T13:50:47.287-05:002012-11-26T13:50:47.287-05:00Something like this https://gist.github.com/414988...Something like this https://gist.github.com/4149886Eugene Kuleshovhttps://www.blogger.com/profile/08736056465101896635noreply@blogger.comtag:blogger.com,1999:blog-29871611.post-12931198131300417772012-11-23T14:07:56.562-05:002012-11-23T14:07:56.562-05:00Nice. Can you post the entire solution? I couldn&#...Nice. Can you post the entire solution? I couldn't come up with anything simple.Andrey Paramonovhttps://www.blogger.com/profile/14375033587137190103noreply@blogger.comtag:blogger.com,1999:blog-29871611.post-49307547538675909712012-11-23T10:30:27.114-05:002012-11-23T10:30:27.114-05:00You can do the same thing in Java. Just need conta...You can do the same thing in Java. Just need containsAny() helper method and then make all your handlers declarative. You can write your own or use one from commons collectionsEugene Kuleshovhttps://www.blogger.com/profile/08736056465101896635noreply@blogger.com