Post ASfZiWDENYanFSNtVw by phoe@functional.cafe
(DIR) More posts by phoe@functional.cafe
(DIR) Post #ASfKcnyRvjrhHjHv72 by veer66@mstdn.io
2023-02-14T09:15:47Z
0 likes, 0 repeats
Why does Common Lisp use with-* macros instead call-with-* functions in Scheme? Is there any advantage of using with-* macros? #CommonLisp
(DIR) Post #ASfNaBr8ypsOLdJdHE by lispegistus@hachyderm.io
2023-02-14T09:48:50Z
0 likes, 1 repeats
@veer66 The advantage is that #CommonLisp doesn't use continuations for control flow, and in general common lisp programs rely on dynamic scope much more and tend not to pass various thunks around as much.
(DIR) Post #ASfZiWDENYanFSNtVw by phoe@functional.cafe
2023-02-14T12:04:11Z
0 likes, 1 repeats
@lispegistus @veer66 Also no new stack frame is allocated because of no function call. Instead, the dynamic scope of the enclosed code is appropriately modified.
(DIR) Post #ASfh1G7n7GwaXBiu80 by phoe@functional.cafe
2023-02-14T12:50:35Z
0 likes, 1 repeats
@lispegistus @veer66 This, in turn, may be because the CL specification does not mandate TCO and implementations sometimes choose to not perform TCO (e.g. when compiling with high debug, in order to preserve the stack history) - so modifying the dynamic context via a macro is preferable to calling a function.Still - some WITH-FOO macros in Lisp libraries are implemented as thin wrappers over respective CALL-WITH-FOO functions - see e.g. ASDF sources, https://gitlab.common-lisp.net/search?search=call-with&nav_source=navbar&project_id=46&group_id=459&search_code=true&repository_ref=master
(DIR) Post #ASfhHFcujffrcguFiy by veer66@mstdn.io
2023-02-14T13:29:23Z
0 likes, 0 repeats
@phoe Sometimes, I'm one of them. @lispegistus
(DIR) Post #ASfxeVxZm1c6CsgZ1c by technomancy@icosahedron.website
2023-02-14T16:03:38Z
0 likes, 1 repeats
@veer66 I think it's because functions are a lot more natural to use in Scheme because it's a lisp-1 but in a lisp-2 you need funcall which makes you more likely to prefer macrosat least, that's how it feels when I use elisp, which is the closest thing to CL that I know
(DIR) Post #ASg0I9ori7Dn1yds48 by veer66@mstdn.io
2023-02-14T17:02:21Z
0 likes, 0 repeats
@technomancy I suppose you are right since I found myself using the LOOP macro instead MAPCAR and REMOVE-IF in Common Lisp. 😅