]> gitweb.factorcode.org Git - factor.git/commitdiff
Factor: Rename <enum> to <enumerated> to not confuse with ENUM:s
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 3 Jul 2017 19:00:44 +0000 (12:00 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 3 Jul 2017 19:47:19 +0000 (12:47 -0700)
21 files changed:
basis/base64/base64-tests.factor
basis/compiler/codegen/gc-maps/gc-maps.factor
basis/compression/huffman/huffman.factor
basis/compression/inflate/inflate.factor
basis/inspector/inspector.factor
basis/math/combinatorics/combinatorics.factor
basis/mirrors/mirrors.factor
basis/xml/syntax/inverse/inverse.factor
basis/xml/syntax/syntax.factor
core/assocs/assocs-docs.factor
core/assocs/assocs.factor
core/classes/tuple/parser/parser.factor
core/generic/single/single.factor
extra/backtrack/backtrack.factor
extra/html/parser/analyzer/analyzer.factor
extra/math/transforms/bwt/bwt.factor
extra/memcached/memcached.factor
extra/multi-methods/multi-methods.factor
extra/sequences/extras/extras.factor
misc/atom/grammars/factor.cson
misc/vim/syntax/factor.vim

index d708c1b3d366b6a268724f4adc6ee6e421493e62..a63f6b3bc63e900f065e309775536b5dfb2d3159 100644 (file)
@@ -38,4 +38,4 @@ sequences splitting strings tools.test ;
 } [
     "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJKb2UifQ.ipevRNuRP6HflG8cFKnmUPtypruRC4fb1DWtoLL62SY"
     "." split [ base64> ] map
-] unit-test
\ No newline at end of file
+] unit-test
index 47e47382c70321a8760338b05e65c6c0fd985d0e..61e9076a6677c988116246646cc3232a5f9ca90f 100644 (file)
@@ -40,7 +40,7 @@ SYMBOLS: return-addresses gc-maps ;
     [ emit-gc-roots ] ?{ } make underlying>> % ;
 
 : emit-base-table ( alist longest -- )
-    -1 <array> <enum> swap assoc-union! seq>> emit-uints ;
+    -1 <array> <enumerated> swap assoc-union! seq>> emit-uints ;
 
 : derived-root-offsets ( gc-map -- offsets )
     derived-roots>> [ [ gc-root-offset ] bi@ ] assoc-map ;
index 33d7b17f052b57747f8e7cde55769943abb2db12..9956f3c55f662c8c02e12a056394ec1c8480d9cb 100644 (file)
@@ -43,7 +43,7 @@ TUPLE: huffman-code
     [ nip '[ _ swap _ set-at ] each ] 3bi ;
 
 :: reverse-table ( tdesc n -- rtable )
-   n f <array> <enum> :> table
+   n f <array> <enumerated> :> table
    tdesc [ n table update-reverse-table ] huffman-each
    table seq>> ;
 
index 400f02e0e24ccd21266aaed9548e6815799ca400..7b74370036c0d264cf62497d186044fdb2a38a84 100644 (file)
@@ -26,7 +26,7 @@ ERROR: bad-zlib-header ;
 CONSTANT: clen-shuffle { 16 17 18 0 8 7 9 6 10 5 11 4 12 3 13 2 14 1 15 }
 
 : get-table ( values size -- table )
-    16 f <array> <enum>
+    16 f <array> <enumerated>
     [ '[ _ push-at ] 2each ] keep
     seq>> rest-slice [ natural-sort ] map ; inline
 
index 70733b1aeae12855427bbadfd4e7a64133d378f9..f0ecd0b8aae6f7ed890f0ab8f8eeb4b4b48ddcf6 100644 (file)
@@ -20,7 +20,7 @@ SYMBOL: +number-rows+
 
 GENERIC: add-numbers ( alist -- table' )
 
-M: enum add-numbers ;
+M: enumerated add-numbers ;
 
 M: assoc add-numbers
     +number-rows+ get [ [ prefix ] map-index ] when ;
index 5f8eb8514fe813262320b8c4cfc293d6b20d3016..6c6792ed8961f4ddfa707d3cf69429d0b0c15d70 100644 (file)
@@ -129,7 +129,7 @@ PRIVATE>
     swapd each-permutation ; inline
 
 : inverse-permutation ( seq -- permutation )
-    <enum> sort-values keys ;
+    <enumerated> sort-values keys ;
 
 <PRIVATE
 
index f6e4cdb2933a368f8535117c793bd2494aedf606..4ac2dc6689d3147025eff08366ed02bc437a39de 100644 (file)
@@ -59,5 +59,5 @@ GENERIC: make-mirror ( obj -- assoc )
 M: hashtable make-mirror ;
 M: hash-set make-mirror members make-mirror ;
 M: integer make-mirror drop f ;
-M: sequence make-mirror <enum> ;
+M: sequence make-mirror <enumerated> ;
 M: object make-mirror <mirror> ;
index dba6469b7da81e69e2c6699840c8cffe67d62b36..983060b81125f91a54e44a17d35731afa8971a7f 100644 (file)
@@ -66,7 +66,7 @@ M: interpolated [undo-xml]
 
 : >enum ( assoc -- enum )
     ! Assumes keys are 0..n
-    sort-keys values <enum> ;
+    sort-keys values <enumerated> ;
 
 : undo-xml ( xml -- quot )
     [undo-xml] '[ H{ } clone [ _ with-variables ] keep >enum ] ;
index 8bea35c615f09dc04fd5732104ab3f0c3ec33314..c2f549679004eb3a5faf046f22d24c0d23934f44 100644 (file)
@@ -152,7 +152,7 @@ MACRO: interpolate-xml ( xml -- quot )
     [ [ var>> , ] each-interpolated ] { } make ;
 
 : nenum ( ... n -- assoc )
-    narray <enum> ; inline
+    narray <enumerated> ; inline
 
 : collect ( accum variables -- accum ? )
     {
index 36b1730ba8e6f8e0d59b12620157d57591423c4c..384f0a79b70f713a9628a20a4f60b7ad98a4a5da 100644 (file)
@@ -19,19 +19,19 @@ $nl
 ARTICLE: "enums" "Enumerations"
 "An enumeration provides a view of a sequence as an assoc mapping integer indices to elements:"
 { $subsections
-    enum
-    <enum>
+    enumerated
+    <enumerated>
 }
 "Inverting a permutation using enumerations:"
-{ $example "IN: scratchpad" ": invert ( perm -- perm' )" "    <enum> sort-values keys ;" "{ 2 0 4 1 3 } invert ." "{ 1 3 0 4 2 }" } ;
+{ $example "IN: scratchpad" ": invert ( perm -- perm' )" "    <enumerated> sort-values keys ;" "{ 2 0 4 1 3 } invert ." "{ 1 3 0 4 2 }" } ;
 
-HELP: enum
+HELP: enumerated
 { $class-description "An associative structure which wraps a sequence and maps integers to the corresponding elements of the sequence."
 $nl
 "Enumerations are mutable; note that deleting a key calls " { $link remove-nth! } ", which results in all subsequent elements being shifted down." } ;
 
-HELP: <enum>
-{ $values { "seq" sequence } { "enum" enum } }
+HELP: <enumerated>
+{ $values { "seq" sequence } { "enumerated" enumerated } }
 { $description "Creates a new enumeration." } ;
 
 ARTICLE: "assocs-protocol" "Associative mapping protocol"
index 3f4b3b890cee2dac285e2273839219b560d6cb50..40fb12ac8169a8b79513f59c516006b42f5ba731 100644 (file)
@@ -281,32 +281,32 @@ M: f assoc-like drop dup assoc-empty? [ drop f ] when ; inline
 
 INSTANCE: sequence assoc
 
-TUPLE: enum { seq read-only } ;
+TUPLE: enumerated { seq read-only } ;
 
-C: <enum> enum
+C: <enumerated> enumerated
 
-M: enum at*
+M: enumerated at*
     seq>> 2dup bounds-check?
     [ nth-unsafe t ] [ 2drop f f ] if ; inline
 
-M: enum set-at seq>> set-nth ; inline
+M: enumerated set-at seq>> set-nth ; inline
 
-M: enum delete-at seq>> remove-nth! drop ; inline
+M: enumerated delete-at seq>> remove-nth! drop ; inline
 
-M: enum >alist ( enum -- alist ) ; inline
+M: enumerated >alist ( enumerated -- alist ) ; inline
 
-M: enum keys seq>> length <iota> >array ; inline
+M: enumerated keys seq>> length <iota> >array ; inline
 
-M: enum values seq>> >array ; inline
+M: enumerated values seq>> >array ; inline
 
-M: enum assoc-size seq>> length ; inline
+M: enumerated assoc-size seq>> length ; inline
 
-M: enum clear-assoc seq>> delete-all ; inline
+M: enumerated clear-assoc seq>> delete-all ; inline
 
-INSTANCE: enum assoc
+INSTANCE: enumerated assoc
 
-M: enum length seq>> length ; inline
+M: enumerated length seq>> length ; inline
 
-M: enum nth-unsafe dupd seq>> nth-unsafe 2array ; inline
+M: enumerated nth-unsafe dupd seq>> nth-unsafe 2array ; inline
 
-INSTANCE: enum immutable-sequence
+INSTANCE: enumerated immutable-sequence
index 08b57a747bf837011da9dc5981a833c280fe2544..1ca47ee2ef5d6d371c6aac6d56f484ef93c17856 100644 (file)
@@ -103,7 +103,7 @@ M: tuple-class boa>object
     over [ slot-named* ] dip check-slot-exists drop ;
 
 : assoc>object ( class slots values -- tuple )
-    [ [ [ initial>> ] map <enum> ] keep ] dip
+    [ [ [ initial>> ] map <enumerated> ] keep ] dip
     swap [ [ slot-named-checked ] curry dip ] curry assoc-map
     assoc-union! seq>> boa>object ;
 
index afa6376983f0854a75970989f0f0049fe3cc81af..bef4a22765e1e0e7fef40bfa9b16f1057f0e85ac 100644 (file)
@@ -157,7 +157,7 @@ GENERIC: compile-engine ( engine -- obj )
     [ over assumed [ compile-engine ] with-variable ] assoc-map ;
 
 : direct-dispatch-table ( assoc n -- table )
-    default get <array> <enum> swap assoc-union! seq>> ;
+    default get <array> <enumerated> swap assoc-union! seq>> ;
 
 : tag-number ( class -- n ) "type" word-prop ;
 
@@ -184,7 +184,7 @@ M: tuple-dispatch-engine compile-engine
     tuple assumed [
         echelons>> compile-engines
         dup keys supremum 1 + f <array>
-        <enum> swap assoc-union! seq>>
+        <enumerated> swap assoc-union! seq>>
     ] with-variable ;
 
 PREDICATE: predicate-engine-word < word "owner-generic" word-prop ;
index a87a031e001f7b079df934d94da8f3729e282364..c7b2da90bd4c077f0dc3414015b0c193a861cc84 100644 (file)
@@ -60,7 +60,7 @@ PRIVATE>
     [ fail f ] [ unsafe-amb ] if-empty ; inline
 
 MACRO: amb-execute ( seq -- quot )
-    [ length 1 - ] [ <enum> [ 1quotation ] assoc-map ] bi
+    [ length 1 - ] [ <enumerated> [ 1quotation ] assoc-map ] bi
     '[ _ 0 unsafe-number-from-to nip _ case ] ;
 
 : if-amb ( true false -- ? )
index b564b9009ba1c0baa7b3623184d98c9eb71bad09..cf275bcba1ac97b3a37c8f77e52efb987d3f8d9c 100644 (file)
@@ -18,7 +18,7 @@ IN: html.parser.analyzer
     swap attributes>> key? ;
 
 : find-all ( seq quot -- alist )
-   [ <enum> >alist ] [ '[ second @ ] ] bi* filter ; inline
+   [ <enumerated> >alist ] [ '[ second @ ] ] bi* filter ; inline
 
 : loopn-index ( n quot -- )
     [ <iota> ] [ '[ @ not ] ] bi* find 2drop ; inline
index 9431f6a8c44ace6de64d9f19f54beae2bd1f290a..1aca5dddad93146537acb801179251d489ec7fdd 100644 (file)
@@ -13,5 +13,5 @@ IN: math.transforms.bwt
 
 : ibwt ( i newseq -- seq )
     [ length ]
-    [ <enum> sort-values '[ _ nth first2 ] ]
+    [ <enumerated> sort-values '[ _ nth first2 ] ]
     [ replicate-as ] tri nip ;
index 8ff2a03de3499dbeec1b8621d756bc13f833a8dc..df3e04e884a4f56a1a442333adf383a9ad53f0cb 100644 (file)
@@ -184,10 +184,10 @@ PRIVATE>
 
 : m/getseq ( keys -- vals )
     [ H{ } clone ] dip
-    [ <enum> [ m/getq ] assoc-each ]
+    [ <enumerated> [ m/getq ] assoc-each ]
     [ length 10 + NOOP <request> swap >>opaque send-request ]
     [
-        <enum> [
+        <enumerated> [
             assoc-size 10 + '[
                 _ read-header [ check-opaque ] keep swap
             ]
index 74b3e0cd6ebd285f35358a08638af257c0d25988..f5637789ea22113b764d4b8151110a05baa98a50 100644 (file)
@@ -41,7 +41,7 @@ SYMBOL: total
     ] assoc-map ;
 
 : canonicalize-specializer-3 ( specializer -- specializer' )
-    [ total get object <array> <enum> ] dip assoc-union! seq>> ;
+    [ total get object <array> <enumerated> ] dip assoc-union! seq>> ;
 
 : canonicalize-specializers ( methods -- methods' hooks )
     [
index c26f4869eefc408db6faaffc0d6935a8ae1970f5..d8e23af43e7d7c43efcf4e070ae22593f6930487 100644 (file)
@@ -5,7 +5,7 @@ vectors ;
 IN: sequences.extras
 
 : find-all ( ... seq quot: ( ... elt -- ... ? ) -- ... elts )
-    [ <enum> ] dip '[ nip @ ] assoc-filter ; inline
+    [ <enumerated> ] dip '[ nip @ ] assoc-filter ; inline
 
 : reduce-from ( ... seq identity quot: ( ... prev elt -- ... next ) i -- ... result )
     [ swap ] 2dip each-from ; inline
@@ -403,10 +403,10 @@ INSTANCE: odds immutable-sequence
     [ dup empty? ] swap until drop ; inline
 
 : arg-max ( seq -- n )
-    <enum> [ second-unsafe ] supremum-by first ;
+    <enumerated> [ second-unsafe ] supremum-by first ;
 
 : arg-min ( seq -- n )
-    <enum> [ second-unsafe ] infimum-by first ;
+    <enumerated> [ second-unsafe ] infimum-by first ;
 
 <PRIVATE
 
index e8b4fc25a698a37f818ba4b7e2c23bf0d0d85d1f..40cb92dee7cd48d0b4986c7b3e10e315e952f1d9 100644 (file)
@@ -81,7 +81,7 @@ patterns: [
     name: "keyword.control.namespaces.factor"
   }
   {
-    match: "(^|(?<=\\s))(>alist|<enum>|2cache|\\?at|\\?of|assoc|assoc>map|assoc-all\\?|assoc-any\\?|assoc-clone-like|assoc-combine|assoc-diff|assoc-diff!|assoc-differ|assoc-each|assoc-empty\\?|assoc-filter|assoc-filter!|assoc-filter-as|assoc-find|assoc-hashcode|assoc-intersect|assoc-like|assoc-map|assoc-map-as|assoc-partition|assoc-refine|assoc-size|assoc-stack|assoc-subset\\?|assoc-union|assoc-union!|assoc=|assoc\\?|at|at\\*|at\\+|cache|change-at|clear-assoc|delete-at|delete-at\\*|enum|enum\\?|extract-keys|inc-at|key\\?|keys|map>assoc|maybe-set-at|new-assoc|of|push-at|rename-at|set-at|sift-keys|sift-values|substitute|unzip|value-at|value-at\\*|value\\?|values|zip|zip-as|zip-index|zip-index-as)(\\s|$)"
+    match: "(^|(?<=\\s))(>alist|<enumerated>|2cache|\\?at|\\?of|assoc|assoc>map|assoc-all\\?|assoc-any\\?|assoc-clone-like|assoc-combine|assoc-diff|assoc-diff!|assoc-differ|assoc-each|assoc-empty\\?|assoc-filter|assoc-filter!|assoc-filter-as|assoc-find|assoc-hashcode|assoc-intersect|assoc-like|assoc-map|assoc-map-as|assoc-partition|assoc-refine|assoc-size|assoc-stack|assoc-subset\\?|assoc-union|assoc-union!|assoc=|assoc\\?|at|at\\*|at\\+|cache|change-at|clear-assoc|delete-at|delete-at\\*|enum|enum\\?|extract-keys|inc-at|key\\?|keys|map>assoc|maybe-set-at|new-assoc|of|push-at|rename-at|set-at|sift-keys|sift-values|substitute|unzip|value-at|value-at\\*|value\\?|values|zip|zip-as|zip-index|zip-index-as)(\\s|$)"
     name: "keyword.control.assocs.factor"
   }
   {
index a112da608e49fd91ba1d16ac2d5966f81d5a1e5e..5aaf1268a4d0e405e841113ad787ff0f5147f280 100644 (file)
@@ -54,7 +54,7 @@ syn match factorExecute /\<execute(\s\+\(\S*\s\+\)*--\(\s\+\S*\)*\s\+)\>/ contai
 syn keyword factorCallNextMethod call-next-method
 
 syn keyword factorKeyword (clone) -rot 2bi 2bi* 2bi@ 2curry 2dip 2drop 2dup 2keep 2nip 2over 2tri 2tri* 2tri@ 2with 3bi 3curry 3dip 3drop 3dup 3keep 3tri 4dip 4drop 4dup 4keep <wrapper> = >boolean ? ?if and assert assert= assert? bi bi* bi-curry bi-curry* bi-curry@ bi@ boa boolean boolean? both? build call callstack callstack>array callstack? clear clone compose composed? curry curried? die dip do drop dup dupd either? eq? equal? execute get-callstack get-datastack get-retainstack hashcode hashcode* identity-hashcode identity-tuple identity-tuple? if if* keep loop most new nip not null object or over pick prepose rot same? swap swapd throw tri tri* tri-curry tri-curry* tri-curry@ tri@ tuple tuple? unless unless* until when when* while with wrapper wrapper? xor
-syn keyword factorKeyword 2cache <enum> >alist ?at ?of assoc assoc-all? assoc-any? assoc-clone-like assoc-combine assoc-diff assoc-diff! assoc-differ assoc-each assoc-empty? assoc-filter assoc-filter! assoc-filter-as assoc-find assoc-hashcode assoc-intersect assoc-like assoc-map assoc-map-as assoc-partition assoc-refine assoc-reject assoc-reject! assoc-reject-as assoc-size assoc-stack assoc-subset? assoc-union assoc-union! assoc= assoc>map assoc? at at* at+ cache change-at clear-assoc delete-at delete-at* enum enum? extract-keys harvest-keys harvest-values inc-at key? keys map>alist map>assoc maybe-set-at new-assoc of push-at rename-at set-at sift-keys sift-values substitute unzip value-at value-at* value? values zip zip-as zip-index zip-index-as
+syn keyword factorKeyword 2cache <enumerated> >alist ?at ?of assoc assoc-all? assoc-any? assoc-clone-like assoc-combine assoc-diff assoc-diff! assoc-differ assoc-each assoc-empty? assoc-filter assoc-filter! assoc-filter-as assoc-find assoc-hashcode assoc-intersect assoc-like assoc-map assoc-map-as assoc-partition assoc-refine assoc-reject assoc-reject! assoc-reject-as assoc-size assoc-stack assoc-subset? assoc-union assoc-union! assoc= assoc>map assoc? at at* at+ cache change-at clear-assoc delete-at delete-at* enum enum? extract-keys harvest-keys harvest-values inc-at key? keys map>alist map>assoc maybe-set-at new-assoc of push-at rename-at set-at sift-keys sift-values substitute unzip value-at value-at* value? values zip zip-as zip-index zip-index-as
 syn keyword factorKeyword 2cleave 2cleave>quot 3cleave 3cleave>quot 4cleave 4cleave>quot alist>quot call-effect case case-find case>quot cleave cleave>quot cond cond>quot deep-spread>quot execute-effect linear-case-quot no-case no-case? no-cond no-cond? recursive-hashcode shallow-spread>quot spread to-fixed-point wrong-values wrong-values?
 syn keyword factorKeyword (all-integers?) (each-integer) (find-integer) * + - / /f /i /mod 2/ 2^ < <= <fp-nan> > >= >bignum >fixnum >float >fraction >integer >rect ?1+ abs align all-integers? bignum bignum? bit? bitand bitnot bitor bits>double bits>float bitxor complex complex? denominator double>bits each-integer even? fast-gcd find-integer find-last-integer fixnum fixnum? float float>bits float? fp-bitwise= fp-infinity? fp-nan-payload fp-nan? fp-qnan? fp-sign fp-snan? fp-special? gcd if-zero imaginary-part integer integer>fixnum integer>fixnum-strict integer? log2 log2-expects-positive log2-expects-positive? mod neg neg? next-float next-power-of-2 number number= number? numerator odd? power-of-2? prev-float ratio ratio? rational rational? real real-part real? recip rect> rem sgn shift sq times u< u<= u> u>= unless-zero unordered? when-zero zero?
 syn keyword factorKeyword 1sequence 2all? 2each 2each-from 2map 2map-as 2map-reduce 2reduce 2selector 2sequence 3append 3append-as 3each 3map 3map-as 3sequence 4sequence <repetition> <reversed> <slice> ?first ?last ?nth ?second ?set-nth accumulate accumulate! accumulate-as all? any? append append! append-as assert-sequence assert-sequence= assert-sequence? binary-reduce bounds-check bounds-check? bounds-error bounds-error? but-last but-last-slice cartesian-each cartesian-map cartesian-product change-nth check-slice clone-like collapse-slice collector collector-for concat concat-as copy count cut cut* cut-slice delete-all delete-slice drop-prefix each each-from each-index empty? exchange filter filter! filter-as find find-from find-index find-index-from find-last find-last-from first first2 first3 first4 flip follow fourth glue halves harvest head head* head-slice head-slice* head? if-empty immutable immutable-sequence immutable-sequence? immutable? index index-from indices infimum infimum-by insert-nth interleave iota iota-tuple iota-tuple? join join-as last last-index last-index-from length lengthen like longer longer? longest map map! map-as map-find map-find-last map-index map-index-as map-integers map-reduce map-sum max-length member-eq? member? midpoint@ min-length mismatch move new-like new-resizable new-sequence non-negative-integer-expected non-negative-integer-expected? nth nths pad-head pad-tail padding partition pop pop* prefix prepend prepend-as produce produce-as product push push-all push-either push-if reduce reduce-index reject reject! reject-as remove remove! remove-eq remove-eq! remove-nth remove-nth! repetition repetition? replace-slice replicate replicate-as rest rest-slice reverse reverse! reversed reversed? second selector selector-for sequence sequence-hashcode sequence= sequence? set-first set-fourth set-last set-length set-nth set-second set-third short shorten shorter shorter? shortest sift slice slice-error slice-error? slice? snip snip-slice subseq-start subseq-start-from subseq subseq? suffix suffix! sum sum-lengths supremum supremum-by surround tail tail* tail-slice tail-slice* tail? third trim trim-head trim-head-slice trim-slice trim-tail trim-tail-slice unclip unclip-last unclip-last-slice unclip-slice unless-empty virtual-exemplar virtual-sequence virtual-sequence? virtual@ when-empty