Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Aren't you adding some assumptions about the implementation in your comment? Common Lisp doesn't require TCO, but it doesn't forbid it either, and SBCL chooses to do it. Your first sentence would be incorrect for a Common Lisp program someone executes with SBCL.


Well, then the statement 'functions many only recurse up to some limit' applies to Common Lisp as specified but not to this implementation of it. This isn't particularly unusual, since language implementations often have capabilities which aren't part of the specifications (see the many extensions to C, for example. e.g. in standard C you can't assume that type punning using a union will be defined, but almost all implementations explicitly allow for it). These are differences in the semantics of the language (namely in what is and isn't allowed), not just optimisations.


> Aren't you adding some assumptions about the implementation in your comment?

You'd have a point if they were talking about implementation semantics, but they're talking about language semantics. A Scheme program can assume TCE, a CL program can not, an SBCL program can.


> an SBCL program can.

SBCL will only perform TCO at specific optimization levels, so you can't even rely on it in SBCL.


It's not clear to me that the person I replied to was talking about language semantics. The phrasing of that comment would have taken the form "may not" or "can't assume", but instead asserted that you can write some code that's guaranteed to run differently, which is implementation semantics.


It says “semantics of Scheme” directly (and IMO unambiguously) upthread. What would that more likely be than the language?


That depends on whether you are claiming your code is written in Common Lisp (the language) or for SBCL (the implementation).

The former will run on other implementations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: