linked-assocs: move prettyprint stuff to its own vocab.
parent
a73340a032
commit
3c06b585d7
|
@ -1,8 +1,7 @@
|
|||
! Copyright (C) 2008 Slava Pestov, James Cash.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors arrays assocs classes deques dlists fry
|
||||
hashtables kernel parser prettyprint.backend prettyprint.custom
|
||||
sequences.private ;
|
||||
hashtables kernel parser sequences.private vocabs.loader ;
|
||||
IN: linked-assocs
|
||||
|
||||
TUPLE: linked-assoc { assoc read-only } { dlist dlist read-only } ;
|
||||
|
@ -64,13 +63,4 @@ M: linked-assoc equal?
|
|||
|
||||
SYNTAX: LH{ \ } [ check-hashtable >linked-hash ] parse-literal ;
|
||||
|
||||
PREDICATE: linked-hash < linked-assoc assoc>> hashtable? ;
|
||||
|
||||
M: linked-hash pprint-delims drop \ LH{ \ } ;
|
||||
|
||||
M: linked-hash >pprint-sequence >alist ;
|
||||
|
||||
M: linked-hash pprint-narrow? drop t ;
|
||||
|
||||
M: linked-hash pprint*
|
||||
[ pprint-object ] with-extra-nesting-level ;
|
||||
{ "linked-assocs" "prettyprint" } "linked-assocs.prettyprint" require-when
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
USING: accessors assocs hashtables kernel linked-assocs
|
||||
prettyprint.backend prettyprint.custom ;
|
||||
IN: linked-assocs.prettyprint
|
||||
|
||||
PREDICATE: linked-hash < linked-assoc assoc>> hashtable? ;
|
||||
|
||||
M: linked-hash pprint-delims drop \ LH{ \ } ;
|
||||
|
||||
M: linked-hash >pprint-sequence >alist ;
|
||||
|
||||
M: linked-hash pprint-narrow? drop t ;
|
||||
|
||||
M: linked-hash pprint*
|
||||
[ pprint-object ] with-extra-nesting-level ;
|
Loading…
Reference in New Issue