Skip to content

Commit

Permalink
uu: simplify a little bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Dec 27, 2015
1 parent 7e40b60 commit 7ddc074
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions extra/uu/uu.factor
@@ -1,8 +1,8 @@
! Copyright (C) 2013 John Benediktsson
! See http://factorcode.org/license.txt for BSD license

USING: combinators.short-circuit io io.streams.string kernel
locals make math math.bitwise namespaces sequences ;
USING: io io.streams.string kernel locals make math math.bitwise
math.order namespaces sequences ;

IN: uu

Expand Down Expand Up @@ -40,15 +40,13 @@ ERROR: bad-length seq ;
ERROR: illegal-character ch ;

: check-illegal-character ( ch -- ch )
dup { [ CHAR: \s < ] [ CHAR: \s 64 + > ] } 1||
[ illegal-character ] when ;
dup CHAR: \s dup 64 + between? [ illegal-character ] unless ;

:: ascii>binary ( seq -- seq' )
0 :> char!
0 :> bits!

seq unclip-slice dup CHAR: \s =
[ drop 0 ] [ CHAR: \s - ] if :> len!
seq unclip-slice CHAR: \s - :> len!

[
[ dup empty? not len 0 > and ] [
Expand Down

0 comments on commit 7ddc074

Please sign in to comment.