Paste: nested comments

Author: blei
Mode: factor
Date: Wed, 29 Apr 2009 15:43:41
Plain Text |
USING: kernel sequences math locals make multiline ;
IN: nested-comments

:: (subsequences-at) ( sseq seq n -- )
    sseq seq n start*
    [ dup , sseq length + [ sseq seq ] dip (subsequences-at) ]
    when* ;

: subsequences-at ( sseq seq -- indices )
    [ 0 (subsequences-at) ] { } make ;

: count-subsequences ( sseq seq -- i )
    subsequences-at length ;

: parse-all-(* ( parsed-vector left-to-parse -- parsed-vector )
    1 - "*)" parse-multiline-string [ "(*" ] dip
    count-subsequences + dup 0 > [ parse-all-(* ] [ drop ] if ;

SYNTAX: (* 1 parse-all-(* ;

Annotation: heavy user

Author: pruned
Mode: factor
Date: Wed, 29 Apr 2009 15:54:14
Plain Text |
USING: accessors arrays assocs byte-arrays combinators
constructors fry grouping hashtables huffman images
images.viewer io io.binary io.encodings.binary io.files
io.files.info io.streams.byte-array io.streams.limited kernel
locals math math.constants math.functions math.matrices
math.order math.parser math.ranges math.vectors memoize
multiline namespaces prettyprint sequences sequences.deep
sorting nested-comments ;
IN: images.jpeg

New Annotation

Summary:
Author:
Mode:
Body: