ref: 00b5c10f48a7eb2990cf3b6a04e5a187492e033c
parent: 5a7e2491675df97bde089b057a255be3093054d8
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sun Mar 16 18:49:01 EDT 2025
fix stacktrace printing
--- a/boot/sl.boot
+++ b/boot/sl.boot
@@ -339,8 +339,9 @@
2523c0780<51472275140T2E8551;J60485R37072@40788551^1@>0722F514780514727G61:" #(type-error
length= princ "type error: expected " ", got " #fn(typeof) caddr ": " print bounds-error "index "
" out of bounds for " unbound-error "eval: variable " " has no value" error "error: " load-error
-ption "in file " list? #fn(str?) "*** Unhandled exception: " *linefeed*) print-exception)
- print-stack-trace #fn("n1IIb5b62085218685>2_51420862285>1_51473740r3523F075076370r5@40r452@300517778292:2;505252Eb92<2=868889>38762:" #(#0#
+ption "in file " list? #fn(str?) "*** Unhandled exception: " *linefeed*) print-exception)
+ print-stack-trace #fn("n1IIb5b620852185>1_51420862285>1_51473740r3523F075076370r5@40r452@300517778292:2;505252Eb92<2=868889>38762:" #(#0#
+ #fn("n32005182P2105121151C?022232487e361:25051E76278851512888A187>4|:" #(#fn(fn-name)
#
#fn("n3A<05182P2005120151C?021222387e361:24051E75268851512788F187>4|:" #(#fn(fn-code)
#fn(raise) thrown-value
@@ -348,10 +349,10 @@
#fn(length)
#fn("n170A0G513>0F<A0G929363:q:" #(closure?))) find-in-f)
#fn("n220A01>321{863E0722374758651522662:27:" #(#fn("n02021AF>292524q:" #(#fn(for-each)
- #fn("n1A<0Fq63:" #())))
+ #fn("n1A<0Fq63:" #())))
und caddr #fn(raise))) str-join #fn(map) str reverse! "/" "λ") fn-name) reverse! length>
list-tail *interactive* filter closure? #fn(map) #fn("n10Z;380420061:" #(#fn(top-level-value)))
-) #fn("n17021A<0KGF52524222374051==52470257652492<El23?0770KG0EG52@30q49292<KM_:" #(princ
+) #fn("n17021A<0KGF52524222374051==52470257652492<El23?0770KG0EG52@30q49292<KM_:" #(princ
51472061:" #(princ " " print)) vec->list ")" *linefeed* disassemble))) print-stack-trace)
print-to-str #fn("n1205021085524228561:" #(#fn(buffer)
#fn(write)
--- a/src/system.lsp
+++ b/src/system.lsp
@@ -1174,7 +1174,7 @@
(for 0 (1- (length v))
(λ (i) (when (closure? (aref v i))
(find-in-f (aref v i) tgt path))))))))
- (def (fn-name f e)
+ (def (fname f e)
(let ((p (catch 'ffound
(begin
(for-each (λ (topfun)
@@ -1188,17 +1188,17 @@
(list-tail st (if *interactive* 5 4))
st)))
(e (filter closure? (map (λ (s) (and (bound? s)
- (top-level-value s)))
+ (top-level-value s)))
(environment))))
(n 0))
(for-each
(λ (f)
- (princ "(" (fn-name (aref f 1) e))
+ (princ "(" (fname (aref f 1) e))
(for-each (λ (p) (princ " ") (print p))
(cdr (cdr (vec->list f))))
(princ ")" *linefeed*)
(when (= n 0)
- (disassemble (aref f 1) (aref f 0)))
+ (fn-disasm (aref f 1) (aref f 0)))
(set! n (+ n 1)))
st)))