[ add-binary-literal ] dip label-fixup ;
: emit-data ( obj label -- )
- over length align-code
- resolve-label
- building get push-all ;
+ over length align-code resolve-label % ;
: emit-binary-literals ( -- )
binary-literal-table get [ emit-data ] assoc-each ;
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs byte-arrays combinators compiler.cfg.builder
continuations fry sequences compiler.tree.propagation.info
-cpu.architecture kernel words make math math.intervals
-math.vectors.simd.intrinsics namespaces ;
+compiler.tree.propagation.nodes cpu.architecture kernel words
+make math math.intervals math.vectors.simd.intrinsics namespaces ;
IN: compiler.tree.propagation.simd
CONSTANT: vector>vector-intrinsics
] "outputs" set-word-prop
: clone-with-value-infos ( node -- node' )
- clone dup in-d>> [ dup value-info ] H{ } map>assoc >>info ;
+ clone dup in-d>> extract-value-info >>info ;
: try-intrinsic ( node intrinsic-quot -- ? )
'[
! Copyright (c) 2008 Slava Pestov\r
! See http://factorcode.org/license.txt for BSD license.\r
USING: kernel accessors namespaces sequences math.parser\r
-calendar validators urls logging html.forms\r
+calendar checksums validators urls logging html.forms\r
http http.server http.server.dispatchers\r
furnace.auth\r
furnace.asides\r
SYMBOL: permit-id\r
\r
: permit-id-key ( realm -- string )\r
- [ >hex 2 CHAR: 0 pad-head ] { } map-as concat\r
- "__p_" prepend ;\r
+ hex-string "__p_" prepend ;\r
\r
: client-permit-id ( realm -- id/f )\r
permit-id-key client-state dup [ string>number ] when ;\r
[ value>> ] [ type>> ] bi parse-const-value ;
: def-const ( const -- )
- [ c-identifier>> create-in dup reset-generic ]
- [ const-value ] bi define-constant ;
+ [ c-identifier>> create-function ] [ const-value ] bi
+ define-constant ;
: def-consts ( consts -- )
[ def-const ] each ;
: define-enum-member ( member -- )
- [ c-identifier>> create-in dup reset-generic ]
- [ value>> ] bi define-constant ;
-
+ [ c-identifier>> create-function ] [ value>> ] bi
+ define-constant ;
+
: def-enum-type ( enum -- )
[ members>> [ define-enum-member ] each ]
[ c-type>> int def-c-type ] bi ;
dup nil? [
drop nil
] [
- [ car ] [ cdr ] bi
+ uncons
[ car lcartesian-product ] [ cdr ] bi
list>array swap [
swap [ swap [ suffix ] with lazy-map ] with lazy-map lconcat
108 max 10000 min <vector> ] keep
3 < [ [ 2 swap push ] keep ] when ;
-: simple? ( n -- ? ) { [ even? ] [ 3 mod 0 = ] [ 5 mod 0 = ] } 1|| ;
+: simple? ( n -- ? ) { [ even? ] [ 3 divisor? ] [ 5 divisor? ] } 1|| ;
PRIVATE>
: write-vocab-manifest ( vocab-manifest-out -- )
"Writing vocabulary manifest to " write dup print flush
vocabs "VOCABS:" prefix
- deploy-libraries get [ libraries get at path>> ] map members "LIBRARIES:" prefix append
+ deploy-libraries get [ library path>> ] map members "LIBRARIES:" prefix append
swap utf8 set-file-lines ;
: prepare-deploy-libraries ( -- )
[ last-line# ] dip = ;
: prev-line-and-this ( document line -- start end )
- swap
- [ drop 1 - 0 2array ]
- [ [ drop ] [ doc-line length ] 2bi 2array ]
- 2bi ;
+ swap [ drop 1 - 0 2array ] [ line-end ] 2bi ;
: join-with-prev ( document line -- )
[ prev-line-and-this ] [ drop ] 2bi
[ join-lines ] change-doc-range ;
: this-line-and-next ( document line -- start end )
- swap
- [ drop 0 2array ]
- [ [ 1 + ] dip [ drop ] [ doc-line length ] 2bi 2array ]
- 2bi ;
+ swap [ drop 0 2array ] [ [ 1 + ] dip line-end ] 2bi ;
: join-with-next ( document line -- )
[ this-line-and-next ] [ drop ] 2bi
>>loc drop ;
: prefer-incremental ( gadget -- )
- dup forget-pref-dim dup pref-dim >>dim drop ;
+ dup forget-pref-dim prefer ;
M: incremental dim-changed drop ;
[ 0 = not ] filter ;
: remove-exclusions ( alist -- alist )
- exclusions [ dup ] H{ } map>assoc assoc-diff ;
+ exclusions unique assoc-diff ;
: process-canonical ( data -- hash hash )
(process-decomposed) [ first* ] filter
} cleave '[ _ _ _ tri ] ;
: firstn-strong ( seq n -- ... )
- [ swap length =/fail ]
- [ firstn ] 2bi ; inline
+ [ assure-length ] [ firstn ] 2bi ; inline
M: sequence [undo-xml] ( sequence -- quot: ( seq -- ) )
remove-blanks [ length ] [ [ [undo-xml] ] { } map-as ] bi
] if ;
: lexer-head? ( string -- ? )
- [
- lexer get [ line-text>> ] [ column>> ] bi tail-slice
- ] dip head? ;
+ [ lexer get rest-of-line ] dip head? ;
: advance-lexer ( n -- )
[ lexer get ] dip [ + ] curry change-column drop ; inline
! Copyright (C) 2009 Slava Pestov, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs classes classes.tuple
+USING: accessors alien.parser arrays assocs classes classes.tuple
effects.parser fry generalizations sequences.generalizations
generic.standard kernel lexer locals macros parser sequences
sets slots vocabs words ;
'[ @ _ [ execute( obj -- obj ) ] each ] effect define-declared ;
: scan-constructor ( -- word class )
- scan-word [ name>> "<" ">" surround create-in dup reset-generic ] keep ;
+ scan-word [ name>> "<" ">" surround create-function ] keep ;
: parse-constructor ( -- class word effect def )
scan-constructor complete-effect ensure-constructor-parameters
bi* <effect> ;
:: define-fortran-function ( return library function parameters -- )
- function create-in dup reset-generic
+ function create-function
return library function parameters return [ c:void ] unless* parse-arglist
[ \ fortran-invoke 5 [ ] nsequence ] dip define-declared ;