Fix circularity

db4
Slava Pestov 2009-02-10 16:42:35 -06:00
parent ab386d01aa
commit 43e6a6987a
3 changed files with 17 additions and 17 deletions

View File

@ -1,10 +1,9 @@
! Copyright (C) 2007, 2008 Daniel Ehrenberg ! Copyright (C) 2007, 2008 Daniel Ehrenberg
! Portions copyright (C) 2009 Slava Pestov ! Portions copyright (C) 2009 Slava Pestov
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs classes.tuple definitions USING: accessors arrays assocs classes.tuple definitions generic
generalizations generic generic.standard hashtables kernel generic.standard hashtables kernel lexer make math parser
lexer make math parser generic.parser sequences sets slots generic.parser sequences sets slots words words.symbol fry ;
words words.symbol fry ;
IN: delegate IN: delegate
: protocol-words ( protocol -- words ) : protocol-words ( protocol -- words )
@ -30,7 +29,7 @@ M: tuple-class group-words
: consult-method ( word class quot -- ) : consult-method ( word class quot -- )
[ drop swap first create-method-in ] [ drop swap first create-method-in ]
[ nip [ , dup second , \ ndip , first , ] [ ] make ] 3bi [ nip [ swap [ second [ [ dip ] curry ] times % ] [ first , ] bi ] [ ] make ] 3bi
define ; define ;
: change-word-prop ( word prop quot -- ) : change-word-prop ( word prop quot -- )

View File

@ -2,7 +2,7 @@
! Cavazos, Slava Pestov. ! Cavazos, Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: kernel sequences sequences.private math combinators USING: kernel sequences sequences.private math combinators
macros quotations fry stack-checker.transforms effects ; macros quotations fry effects ;
IN: generalizations IN: generalizations
<< <<
@ -95,11 +95,3 @@ MACRO: nweave ( n -- )
[ narray concat ] dip like ; inline [ narray concat ] dip like ; inline
: nappend ( n -- seq ) narray concat ; inline : nappend ( n -- seq ) narray concat ; inline
: nths-quot ( indices -- quot )
[ [ '[ _ swap nth ] ] map ] [ length ] bi
'[ _ cleave _ narray ] ;
\ shuffle [
shuffle-mapping nths-quot
] 1 define-transform

View File

@ -4,8 +4,8 @@ USING: fry accessors arrays kernel words sequences generic math
namespaces make quotations assocs combinators classes.tuple namespaces make quotations assocs combinators classes.tuple
classes.tuple.private effects summary hashtables classes generic classes.tuple.private effects summary hashtables classes generic
sets definitions generic.standard slots.private continuations locals sets definitions generic.standard slots.private continuations locals
stack-checker.backend stack-checker.state stack-checker.visitor generalizations stack-checker.backend stack-checker.state
stack-checker.errors stack-checker.values stack-checker.visitor stack-checker.errors stack-checker.values
stack-checker.recursive-state ; stack-checker.recursive-state ;
IN: stack-checker.transforms IN: stack-checker.transforms
@ -155,3 +155,12 @@ IN: stack-checker.transforms
\ memq? [ \ memq? [
dup sequence? [ memq-quot ] [ drop f ] if dup sequence? [ memq-quot ] [ drop f ] if
] 1 define-transform ] 1 define-transform
! Shuffling
: nths-quot ( indices -- quot )
[ [ '[ _ swap nth ] ] map ] [ length ] bi
'[ _ cleave _ narray ] ;
\ shuffle [
shuffle-mapping nths-quot
] 1 define-transform