jscl icon indicating copy to clipboard operation
jscl copied to clipboard

(trace write)

Open vlad-km opened this issue 4 years ago • 2 comments

Hmm

Welcome to JSCL (version aaa2365 built on 9 May 2021)

JSCL is a Common Lisp implementation on Javascript.
For more information, visit the project page at GitHub.

CL-USER> (defun ops (a &key (s 'a)))
OPS
CL-USER> (trace ops)
(OPS)
CL-USER> (trace print)
(PRINT)
CL-USER> (trace write)
ERROR: Maximum call stack size exceeded
Uncaught RangeError: Maximum call stack size exceeded
    at internals.Symbol.JSCL_USER_CHAR [as fvalue] (jscl.js:7849)
    at jscl.js:30435
    at internals.Symbol.JSCL_USER_GETFORMATPARAMETER [as fvalue] (jscl.js:30436)
    at jscl.js:30457
    at jscl.js:30461
    at jscl.js:30462
    at jscl.js:30507
    at jscl.js:30510
    at jscl.js:30511
    at jscl.js:30513

vlad-km avatar Jun 03 '21 13:06 vlad-km

This is pretty common in most Lisp implementations I think. trace will need some underlying code to run, so tracing any of that code will make it endlessly recurse.

If this is inconvenient, we can make sure write is never called from JSCL itself, but internal functions only. and write is provided on top of them only for the user. But tracing internals will always be risky I guess.

davazp avatar Jun 03 '21 15:06 davazp

Probably this case should be noted as a limitation on the use of the trase.

vlad-km avatar Jun 03 '21 16:06 vlad-km

Closed #446

vlad-km avatar Sep 08 '22 15:09 vlad-km