Better handling of case when user-defined accessor becomes auto-generated

db4
Slava Pestov 2009-03-06 23:33:03 -06:00
parent d27bbe844c
commit 44815fd981
2 changed files with 7 additions and 3 deletions

View File

@ -5,7 +5,7 @@ sequences strings vectors words words.symbol quotations io
combinators sorting splitting math.parser effects continuations
io.files vocabs io.encodings.utf8 source-files
classes hashtables compiler.errors compiler.units accessors sets
lexer vocabs.parser ;
lexer vocabs.parser slots ;
IN: parser
: location ( -- loc )
@ -223,8 +223,8 @@ print-use-hook [ [ ] ] initialize
swap assoc-diff keys [
{
{ [ dup where dup [ first ] when file get path>> = not ] [ f ] }
{ [ dup "reading" word-prop ] [ f ] }
{ [ dup "writing" word-prop ] [ f ] }
{ [ dup reader-method? ] [ f ] }
{ [ dup writer-method? ] [ f ] }
[ t ]
} cond nip
] filter ;

View File

@ -10,8 +10,12 @@ TUPLE: slot-spec name offset class initial read-only ;
PREDICATE: reader < word "reader" word-prop ;
PREDICATE: reader-method < method-body "reading" word-prop ;
PREDICATE: writer < word "writer" word-prop ;
PREDICATE: writer-method < method-body "writing" word-prop ;
: <slot-spec> ( -- slot-spec )
slot-spec new
object bootstrap-word >>class ;