]> gitweb.factorcode.org Git - factor.git/commitdiff
more use of H{ } make.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 19 Jul 2012 18:24:45 +0000 (11:24 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 19 Jul 2012 18:24:45 +0000 (11:24 -0700)
13 files changed:
basis/bootstrap/image/image.factor
basis/help/help.factor
basis/mime/types/types.factor
basis/models/mapping/mapping-tests.factor
basis/prettyprint/config/config.factor
basis/prettyprint/prettyprint.factor
basis/xml-rpc/xml-rpc.factor
basis/xml/name/name.factor
extra/game/models/obj/obj.factor
extra/google/translate/translate.factor
extra/mason/notify/notify.factor
extra/opencl/opencl.factor
extra/twitter/twitter.factor

index a9d79cbef6a2273f93e0e49ac0858dad3ea07ce8..9633c966792d431c65b7001cb7fd7f94eb46216b 100755 (executable)
@@ -585,14 +585,14 @@ M: quotation '
 PRIVATE>
 
 : make-image ( arch -- )
-    [
-        parser-quiet? off
-        auto-use? off
-        architecture set
+    architecture associate H{
+        { parser-quiet? f }
+        { auto-use? f }
+    } assoc-union! [
         "resource:/core/bootstrap/stage1.factor" run-file
         build-image
         write-image
-    ] with-scope ;
+    ] with-variables ;
 
 : make-images ( -- )
     images [ make-image ] each ;
index 501c5f01ea62e76be2576981d595c7c7b0969b52..2140e71f42b83e602b86fd61fc9645772a42947b 100644 (file)
@@ -102,7 +102,7 @@ M: word set-article-parent swap "help-parent" set-word-prop ;
     [ prefix 1array ] dip prefix , ;
 
 : ($navigation-table) ( element -- )
-    help-path-style get table-style set [ $table ] with-scope ;
+    help-path-style get table-style [ $table ] with-variable ;
 
 : $navigation-table ( topic -- )
     [
index 90b856ef23c07390e7ee00a24012d08891735b00..75a2d92ae68fc48c48eddfc7797e3f2c125af4a9 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: io.pathnames io.files io.encodings.ascii
 io.encodings.binary io.encodings.utf8 assocs sequences
-splitting kernel namespaces fry memoize ;
+splitting kernel make fry memoize ;
 IN: mime.types
 
 MEMO: mime-db ( -- seq )
@@ -18,8 +18,8 @@ MEMO: mime-db ( -- seq )
 
 MEMO: mime-types ( -- assoc )
     [
-        mime-db [ unclip '[ [ _ ] dip set ] each ] each
-    ] H{ } make-assoc
+        mime-db [ unclip '[ [ _ ] dip ,, ] each ] each
+    ] H{ } make
     nonstandard-mime-types assoc-union ;
 
 : mime-type ( filename -- mime-type )
index 6e1a1dc8d09c4db6fc63cb6e7790c99d0739001e..eeae10ae2af9434ab44b11e601edb0c4735e2690 100644 (file)
@@ -1,13 +1,13 @@
 USING: arrays generic kernel math models namespaces sequences assocs\r
-tools.test models.mapping accessors ;\r
+tools.test models.mapping accessors make ;\r
 IN: models.mapping.tests\r
 \r
 ! Test mapping\r
 [ ] [\r
     [\r
-        1 <model> "one" set\r
-        2 <model> "two" set\r
-    ] H{ } make-assoc\r
+        1 <model> "one" ,,\r
+        2 <model> "two" ,,\r
+    ] H{ } make\r
     <mapping> "m" set\r
 ] unit-test\r
 \r
index 0b2c4b888b55e31edaa874b4915ebe7936b5752e..ed18ee71dccee307e7438a364adee3ceb78963b7 100644 (file)
@@ -19,25 +19,23 @@ SYMBOL: c-object-pointers?
 15 nesting-limit set-global
 100 length-limit set-global
 10 number-base set-global
-string-limit? on
+t string-limit? set-global
 
 : with-short-limits ( quot -- )
-    [
-        1 line-limit set
-        15 length-limit set
-        2 nesting-limit set
-        string-limit? on
-        boa-tuples? on
-        c-object-pointers? off
-        call
-    ] with-scope ; inline
+    H{
+        { line-limit 1 }
+        { length-limit 15 }
+        { nesting-limit 2 }
+        { string-limit? t }
+        { boa-tuples? t }
+        { c-object-pointers? f }
+    } clone swap with-variables ; inline
 
 : without-limits ( quot -- )
-    [
-        nesting-limit off
-        length-limit off
-        line-limit off
-        string-limit? off
-        c-object-pointers? off
-        call
-    ] with-scope ; inline
+    H{
+        { nesting-limit f }
+        { length-limit f }
+        { line-limit f }
+        { string-limit? f }
+        { c-object-pointers? f }
+    } clone swap with-variables ; inline
index 162b4808242b186fedb23664ee9d528990c5b3dd..5e7217cf89627993d2919f168f4ddae3e7acc930 100644 (file)
@@ -101,11 +101,10 @@ SYMBOL: ->
         [
             "Quotation: " write
             dup [ second ] [ third ] bi remove-breakpoints
-            [
-                3 nesting-limit set
-                100 length-limit set
-                pprint
-            ] with-scope
+            H{
+                { nesting-limit 3 }
+                { length-limit 100 }
+            } clone [ pprint ] with-variables
         ] with-cell
     ] with-row
     dup frame-word? [
index 795e9146b3eb9d5fb180bb8abe127d065fc8102a..70f5d4d16dac08fd69380f1d401b4993e6955f7c 100644 (file)
@@ -70,7 +70,7 @@ M: base64 item>xml
     params <XML <methodResponse><-></methodResponse> XML> ;
 
 : return-fault ( fault-code fault-string -- xml )
-    [ "faultString" set "faultCode" set ] H{ } make-assoc item>xml
+    [ "faultString" ,, "faultCode" ,, ] H{ } make item>xml
     <XML
         <methodResponse>
             <fault>
index 95557cb2c46067a93bf3196883a2a6b81b042476..dd83e892baa9c215046d44bab9e0e47eb1fd2a30 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel namespaces accessors xml.tokenize xml.data assocs
 xml.errors xml.char-classes combinators.short-circuit splitting
-fry xml.state sequences combinators ascii math ;
+fry xml.state sequences combinators ascii math make ;
 IN: xml.name
 
 ! XML namespace processing: ns = namespace
@@ -15,13 +15,13 @@ SYMBOL: ns-stack
     [
         [
             swap dup space>> "xmlns" =
-            [ main>> set ]
+            [ main>> ,, ]
             [
                 T{ name f "" "xmlns" f } names-match?
-                [ "" set ] [ drop ] if
+                [ "" ,, ] [ drop ] if
             ] if
         ] assoc-each
-    ] { } make-assoc f like ;
+    ] { } make f like ;
 
 : add-ns ( name -- )
     dup space>> dup ns-stack get assoc-stack
index 9b661c9fd2d505fb4ab11e4b27ff0ecea03d7fc5..1bfe01c9200fea6c6637d57c8da7ee0815744e1c 100644 (file)
@@ -76,9 +76,9 @@ TUPLE: material
 
 : read-mtl ( file -- material-dictionary )
     [
-        f current-material set
-        H{ } clone material-dictionary set
-    ] H{ } make-assoc
+        f current-material ,,
+        H{ } clone material-dictionary ,,
+    ] H{ } make
     [
         ascii file-lines [ line>mtl ] each
         md
@@ -104,7 +104,7 @@ VERTEX-FORMAT: obj-vertex-format
             [ 1 - vt get nth ] bi* 2array flatten
         ] }
     } case ;
-          
+
 : quad>aos ( x -- y z )
     [ 3 head [ triangle>aos 1array ] map ]
     [ [ 2 swap nth ]
index 61bea2044fc95f4b910eb23cb7445a081d378ff1..32049d524f16b1fc2c3c4ac4c58d3221bb7dacab 100644 (file)
@@ -10,9 +10,9 @@ CONSTANT: maximum-translation-size 5120
 
 : parameters>assoc ( text from to -- assoc )
     "|" glue [
-        [ "q" set ] [ "langpair" set ] bi*
-        "1.0" "v" set
-    ] { } make-assoc ;
+        [ "q" ,, ] [ "langpair" ,, ] bi*
+        "1.0" "v" ,,
+    ] { } make ;
 
 : assoc>query-response ( assoc -- response )
     google-translate-url http-post nip ;
index 7946c3b0d3bb31abbf663ba1b530ab3d8bf5dbee..7cedb2d52ea9c2798a7f9d83ad42a14afdb0e071 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors fry http.client io io.encodings.utf8 io.files
 kernel mason.common mason.config mason.email mason.twitter
-namespaces prettyprint sequences debugger continuations ;
+namespaces prettyprint sequences debugger continuations make ;
 IN: mason.notify
 
 : status-notify? ( -- ? )
@@ -11,14 +11,14 @@ IN: mason.notify
 
 : status-params ( report arg message -- assoc )
     [
-        short-host-name "host-name" set
-        target-cpu get "target-cpu" set
-        target-os get "target-os" set
-        status-secret get "secret" set
-        [ "report" set ]
-        [ "arg" set ]
-        [ "message" set ] tri*
-    ] H{ } make-assoc ;
+        short-host-name "host-name" ,,
+        target-cpu get "target-cpu" ,,
+        target-os get "target-os" ,,
+        status-secret get "secret" ,,
+        [ "report" ,, ]
+        [ "arg" ,, ]
+        [ "message" ,, ] tri*
+    ] H{ } make ;
 
 : status-notify ( report arg message -- )
     status-notify? [
index fab4b55322b0dda71af3f0b600007b74ccd9aac8..a5753fe42743f964a0db795f737a7433aa65033b 100644 (file)
@@ -34,7 +34,7 @@ ERROR: cl-error err ;
 
 : 2info ( handle1 handle2 name info_quot lift_quot -- value )
     [ 4dup 2info-data-size 2info-data-bytes ] dip call ; inline
-    
+
 : info-bool ( handle name quot -- ? )
     [ uint deref CL_TRUE = ] info ; inline
 
@@ -414,15 +414,16 @@ M: cl-filter-linear  filter-mode-constant drop CL_FILTER_LINEAR ;
 GENERIC: bind-kernel-arg ( kernel index data -- )
 M: cl-buffer  bind-kernel-arg bind-kernel-arg-buffer ;
 M: byte-array bind-kernel-arg bind-kernel-arg-data ;
+
 PRIVATE>
 
 : with-cl-state ( context/f device/f queue/f quot -- )
     [
         [
-            [ cl-current-queue   set ] when*
-            [ cl-current-device  set ] when*
-            [ cl-current-context set ] when*
-        ] 3curry H{ } make-assoc
+            [ cl-current-queue   ,, ] when*
+            [ cl-current-device  ,, ] when*
+            [ cl-current-context ,, ] when*
+        ] 3curry H{ } make
     ] dip with-variable ; inline
 
 : cl-platforms ( -- platforms )
index 5cba69d8e30c0f0639e71ff37b89dff63f8732a3..2556732a6cff4c5209331152870b7028b85b51dd 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009, 2010 Joe Groff, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs combinators hashtables http
-http.client json.reader kernel macros namespaces sequences
+http.client json.reader kernel macros make namespaces sequences
 io.sockets.secure fry oauth urls ;
 FROM: assocs => change-at ;
 IN: twitter
@@ -131,9 +131,9 @@ PRIVATE>
 
 : update-post-data ( update -- assoc )
     [
-        "status" set
-        twitter-source get "source" set
-    ] H{ } make-assoc ;
+        "status" ,,
+        twitter-source get "source" ,,
+    ] H{ } make ;
 
 : (tweet) ( string -- json )
     update-post-data "update" status-url