Merge branch 'master' of git://factorcode.org/git/factor
commit
3e8d928d29
|
@ -0,0 +1 @@
|
|||
Joe Groff
|
|
@ -0,0 +1,6 @@
|
|||
IN: byte-arrays.hex
|
||||
USING: byte-arrays help.markup help.syntax ;
|
||||
|
||||
HELP: HEX{
|
||||
{ $syntax "HEX{ 0123 45 67 89abcdef }" }
|
||||
{ $description "Constructs a " { $link byte-array } " from data specified in hexadecimal format. Whitespace between the curly braces is ignored." } ;
|
|
@ -0,0 +1,11 @@
|
|||
! Copyright (C) 2009 Joe Groff.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: grouping lexer ascii parser sequences kernel math.parser ;
|
||||
IN: byte-arrays.hex
|
||||
|
||||
SYNTAX: HEX{
|
||||
"}" parse-tokens "" join
|
||||
[ blank? not ] filter
|
||||
2 group [ hex> ] B{ } map-as
|
||||
parsed ;
|
||||
|
|
@ -23,10 +23,6 @@ $nl
|
|||
|
||||
ABOUT: "byte-arrays"
|
||||
|
||||
HELP: HEX{
|
||||
{ $syntax "HEX{ 0123 45 67 89abcdef }" }
|
||||
{ $description "Constructs a " { $link byte-array } " from data specified in hexadecimal format. Whitespace between the curly braces is ignored." } ;
|
||||
|
||||
HELP: byte-array
|
||||
{ $description "The class of byte arrays. See " { $link "syntax-byte-arrays" } " for syntax and " { $link "byte-arrays" } " for general information." } ;
|
||||
|
||||
|
|
|
@ -1,16 +1,9 @@
|
|||
! Copyright (C) 2007, 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors alien.accessors ascii grouping kernel
|
||||
kernel.private lexer math math.parser parser sequences
|
||||
sequences.private ;
|
||||
USING: accessors kernel kernel.private alien.accessors sequences
|
||||
sequences.private math ;
|
||||
IN: byte-arrays
|
||||
|
||||
SYNTAX: HEX{
|
||||
"}" parse-tokens "" join
|
||||
[ blank? not ] filter
|
||||
2 group [ hex> ] B{ } map-as
|
||||
parsed ;
|
||||
|
||||
M: byte-array clone (clone) ;
|
||||
M: byte-array length length>> ;
|
||||
M: byte-array nth-unsafe swap >fixnum alien-unsigned-1 ;
|
||||
|
|
Loading…
Reference in New Issue