diff --git a/basis/debugger/debugger.factor b/basis/debugger/debugger.factor index 2fad0e4c2e..1e08896e8d 100644 --- a/basis/debugger/debugger.factor +++ b/basis/debugger/debugger.factor @@ -174,6 +174,8 @@ M: no-method error. M: bad-slot-value summary drop "Bad store to specialized slot" ; +M: bad-slot-name summary drop "Bad slot name in object literal" ; + M: no-math-method summary drop "No suitable arithmetic method" ; diff --git a/core/classes/tuple/parser/parser.factor b/core/classes/tuple/parser/parser.factor index 0a57ad34f3..626cbd63df 100644 --- a/core/classes/tuple/parser/parser.factor +++ b/core/classes/tuple/parser/parser.factor @@ -99,9 +99,17 @@ GENERIC# boa>object 1 ( class slots -- tuple ) M: tuple-class boa>object swap prefix >tuple ; +ERROR: bad-slot-name class slot ; + +: check-slot-exists ( class initials slot-spec/f index/f name -- class initials slot-spec index ) + over [ drop ] [ nip nip nip bad-slot-name ] if ; + +: slot-named-checked ( class initials name slots -- class initials slot-spec ) + over [ slot-named* ] dip check-slot-exists drop ; + : assoc>object ( class slots values -- tuple ) [ [ [ initial>> ] map ] keep ] dip - swap [ [ slot-named* drop ] curry dip ] curry assoc-map + swap [ [ slot-named-checked ] curry dip ] curry assoc-map [ dup ] dip update boa>object ; : parse-tuple-literal-slots ( class slots -- tuple )