shithub: femtolisp

Download patch

ref: 5c4ffb3f45d3ebc1590c395a603bc60cf81de5a9
parent: 274bea2da8ccb512cb47f6fc02e6acbd3d561c67
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Fri Nov 29 21:52:32 EST 2024

type error: print the actual type as well

--- a/flisp.boot
+++ b/flisp.boot
@@ -339,11 +339,11 @@
 							       #fn("7000n07071A62:" #(for-each
   write)) #fn("6000n1A50420061:" #(#fn(raise)))) princ)
 	    print #fn("9000z07071062:" #(for-each write) print) print-exception
-	    #fn("=000n10B;3D040<20Q;3:04710r3523I072230T24534757605151@ 00B;3D040<27Q;3:04710r3523I072287605129534750T51@\xee00B;3D040<2:Q;3:04710r2523?0722;0T2<53@\xc600B;38040<2=Q3B0722>514720=f2@\xa700B;38040<2?Q3G07@76051514722A0T52@\x8307B051;3:04710r2523c0750<514722C5140T2D8551;I60485R37072@40758551^1@>0722E514750514727F61:" #(type-error
-  length= princ "type error: expected " ", got " print caddr bounds-error "index "
-  " out of bounds for " unbound-error "eval: variable " " has no value" error
-  "error: " load-error print-exception "in file " list? ": " #fn(string?)
-  "*** Unhandled exception: " *linefeed*) print-exception)
+	    #fn("=000n10B;3D040<20Q;3:04710r3523T072230T2425760515127554787605151@ 00B;3D040<29Q;3:04710r3523I0722:760512;534780T51@\xee00B;3D040<2<Q;3:04710r2523?0722=0T2>53@\xc600B;38040<2?Q3B0722@514720=f2@\xa700B;38040<2AQ3G07B76051514722C0T52@\x8307D051;3:04710r2523c0780<51472275140T2E8551;I60485R37072@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 print-exception "in file " list?
+  #fn(string?) "*** Unhandled exception: " *linefeed*) print-exception)
 	    print-stack-trace #fn("@000n1DD\x8a5\x8a6852085>1_4862185>1_472730r3523F074075370r5@40r452@30051767728292:505252E\x8a97;2<868889>38762:" #(#fn(">000n32005182P2105121151C?022232487e361:2505126E77288851512988A187>463:" #(#fn(function:name)
   #fn(function:code) #fn(raise) thrown-value ffound #fn(function:vals) #.for 1-
   #fn(length) #fn("8000n170A0G513>0F<A0G929363:D:" #(closure?))) find-in-f)
--- a/system.lsp
+++ b/system.lsp
@@ -952,7 +952,7 @@
   (cond ((and (pair? e)
               (eq? (car e) 'type-error)
               (length= e 3))
-         (princ "type error: expected " (cadr e) ", got ")
+         (princ "type error: expected " (cadr e) ", got " (typeof (caddr e)) ": ")
          (print (caddr e)))
 
         ((and (pair? e)