From: Slava Pestov Date: Thu, 3 Jul 2008 21:46:21 +0000 (-0500) Subject: Fix conflict X-Git-Tag: 0.94~2941 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=ef2fddb1ec6f4546cb589b6e7da46bb87289b485 Fix conflict --- ef2fddb1ec6f4546cb589b6e7da46bb87289b485 diff --cc core/classes/tuple/tuple.factor index 59a2d15749,6056d200be..830ace3bf6 --- a/core/classes/tuple/tuple.factor +++ b/core/classes/tuple/tuple.factor @@@ -107,41 -103,10 +107,41 @@@ ERROR: bad-superclass class : superclass-size ( class -- n ) superclasses but-last-slice - [ slot-names length ] map sum ; + [ slot-names length ] sigma ; +: (instance-check-quot) ( class -- quot ) + [ + \ dup , + [ "predicate" word-prop % ] + [ [ bad-slot-value ] curry , ] bi + \ unless , + ] [ ] make ; + +: (fixnum-check-quot) ( class -- quot ) + (instance-check-quot) fixnum "coercer" word-prop prepend ; + +: instance-check-quot ( class -- quot ) + { + { [ dup object bootstrap-word eq? ] [ drop [ ] ] } + { [ dup "coercer" word-prop ] [ "coercer" word-prop ] } + { [ dup \ fixnum class<= ] [ (fixnum-check-quot) ] } + [ (instance-check-quot) ] + } cond ; + +: boa-check-quot ( class -- quot ) + all-slots 1 tail [ class>> instance-check-quot ] map spread>quot ; + +: define-boa-check ( class -- ) + dup boa-check-quot "boa-check" set-word-prop ; + +: tuple-prototype ( class -- prototype ) + [ all-slots [ initial>> ] map ] keep slots>tuple ; + +: define-tuple-prototype ( class -- ) + dup tuple-prototype "prototype" set-word-prop ; + : generate-tuple-slots ( class slots -- slot-specs ) - over superclass-size 2 + simple-slots ; + over superclass-size 2 + make-slots deprecated-slots ; : define-tuple-slots ( class -- ) dup dup "slot-names" word-prop generate-tuple-slots diff --cc core/optimizer/inlining/inlining.factor index 9647f42d51,bbeb5e044f..e36d38180c --- a/core/optimizer/inlining/inlining.factor +++ b/core/optimizer/inlining/inlining.factor @@@ -48,25 -48,21 +48,25 @@@ DEFER: (flat-length { [ dup word? ] [ word-flat-length ] } [ drop 1 ] } cond - ] map sum ; + ] sigma ; -: flat-length ( seq -- n ) - [ word-def (flat-length) ] with-scope ; +: flat-length ( word -- n ) + [ def>> (flat-length) ] with-scope ; ! Single dispatch method inlining optimization -: node-class# ( node n -- class ) - over node-in-d ?nth node-class ; +! : dispatching-class ( node generic -- method/f ) +! tuck dispatch# over in-d>> ?nth 2dup node-literal? +! [ node-literal swap single-effective-method ] +! [ node-class swap specific-method ] +! if ; -: dispatching-class ( node word -- class ) - [ dispatch# node-class# ] keep specific-method ; +: dispatching-class ( node generic -- method/f ) + tuck dispatch# over in-d>> ?nth + node-class swap specific-method ; -: inline-standard-method ( node word -- node ) - 2dup dispatching-class dup - [ swap method 1quotation f splice-quot ] [ 3drop t ] if ; +: inline-standard-method ( node generic -- node ) + dupd dispatching-class dup + [ 1quotation f splice-quot ] [ 2drop t ] if ; ! Partial dispatch of math-generic words : normalize-math-class ( class -- class' ) diff --cc core/sequences/sequences-docs.factor index a753e478bf,a7481d46d5..7cf83d2e37 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@@ -1,6 -1,5 +1,5 @@@ -USING: arrays bit-arrays help.markup help.syntax math -sequences.private vectors strings quotations sbufs kernel math.order ; +USING: arrays help.markup help.syntax math - sequences.private vectors strings sbufs kernel math.order - layouts ; ++sequences.private vectors strings kernel math.order ; IN: sequences ARTICLE: "sequences-unsafe" "Unsafe sequence operations"