Post AMujN3WbZ2cZ3Rifi4 by loke@functional.cafe
 (DIR) More posts by loke@functional.cafe
 (DIR) Post #AMugiW1iUTepfboSoK by veer66@mstdn.io
       2022-08-26T07:51:28Z
       
       0 likes, 0 repeats
       
       Common Lisp's macros aren't necessarily as complex as the loop macro. The pattern of most macros is similar to with-open-file, comparable to yield in Python and Ruby. In contrast, Clojure requires less of this pattern because a programmer can rely on a lazy sequence or a transducer instead.  #commonlisp #clojure #macro
       
 (DIR) Post #AMuhHi8vQzvjNpy1z6 by schaueho@functional.cafe
       2022-08-26T07:57:48Z
       
       0 likes, 0 repeats
       
       @veer66 I don't get why this should be the case. Macros provide a way to build your own language ("domain specific") which to me is very orthogonal to the question of using lazy evaluation or transducers.Or am I misunderstanding you?
       
 (DIR) Post #AMui8lkCm915tthkDg by veer66@mstdn.io
       2022-08-26T08:07:25Z
       
       0 likes, 0 repeats
       
       @schaueho > Or am I misunderstanding you?I don't know.>  which to me is very orthogonal to the question of using lazy evaluation or transducers.Maybe it isn't orthogonal to others because I found so many (defmacro with-...) in the Common Lisp codebase, in which the macro is for iterating over something that can be a sequence or a tree or others, and substitute inside the loop with ,@body. By doing this, they can avoid creating a long list as an output.
       
 (DIR) Post #AMujN3WbZ2cZ3Rifi4 by loke@functional.cafe
       2022-08-26T08:20:47Z
       
       0 likes, 0 repeats
       
       @schaueho @veer66 I think the argument is that a lot of CL macros implements WITH- style constructs. This particular macro isn't needed in the other languages.Or to put it in another way, Clojure has some features that are part of the language where CL requires macros to get the same effect.Whether that's a good or a bad thing depends on perspective I think.
       
 (DIR) Post #AMujmzqjqqAhBXVSL2 by veer66@mstdn.io
       2022-08-26T08:25:53Z
       
       0 likes, 0 repeats
       
       @loke I agree. For me, WITH-style macros are even easier to understand than lazy-cons. 😅  If I don't need to deal with lazy-cons, I prefer a lazy sequence because I can use the map function and friends.@schaueho