From 7d8802bb51e5f907e661469b94bf352766d7ffde Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 11 Aug 2011 04:58:15 +0000 Subject: * interp/lisp-backend.boot (expandBytevec2str): Use MAP instead of COERCE. Eliminate second argument. (expandStr2bytevec): Use MAP instead of COERCE. * algebra/data.spad.pamphlet (ByteBuffer) [coerce]: Adjust call to %bytevec2str. --- src/ChangeLog | 8 ++++++++ src/algebra/data.spad.pamphlet | 4 ++-- src/interp/lisp-backend.boot | 8 +++++--- 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 8a3b40b0..f017d8bb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2011-08-10 Gabriel Dos Reis + + * interp/lisp-backend.boot (expandBytevec2str): Use MAP instead of + COERCE. Eliminate second argument. + (expandStr2bytevec): Use MAP instead of COERCE. + * algebra/data.spad.pamphlet (ByteBuffer) [coerce]: Adjust call to + %bytevec2str. + 2011-08-10 Gabriel Dos Reis * algebra/float.spad.pamphlet (Float): Tidy. diff --git a/src/algebra/data.spad.pamphlet b/src/algebra/data.spad.pamphlet index 5f060343..bcb80de0 100644 --- a/src/algebra/data.spad.pamphlet +++ b/src/algebra/data.spad.pamphlet @@ -313,7 +313,7 @@ ByteBuffer(): Public == Private where ++ `buf'. Error if `n' is more than the capacity. finiteAggregate ++ A ByteBuffer object is a finite aggregate Private == add - import %bytevec2str: (PrimitiveArray Byte,NNI) -> String + import %bytevec2str: PrimitiveArray Byte -> String from Foreign Builtin -- A buffer object is a pair of a simple array, and the count @@ -364,7 +364,7 @@ ByteBuffer(): Public == Private where rep(buf).ary coerce(buf: %): String == - %bytevec2str(rep(buf).ary,#buf) + %bytevec2str rep(buf).ary construct l == buf := makeByteBuffer(#l) diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot index 8426a531..36075241 100644 --- a/src/interp/lisp-backend.boot +++ b/src/interp/lisp-backend.boot @@ -317,11 +317,13 @@ expandStrlt ['%strlt,x,y] == expandStrstc ['%strstc,x,y,z] == expandToVMForm ['%store,['%schar,x,y],z] -expandBytevec2str ['%bytevec2str,x,y] == - ['COERCE,['SUBSEQ,expandToVMForm x,0,expandToVMForm y],quoteForm '%String] +expandBytevec2str ['%bytevec2str,x] == + ['MAP,quoteForm 'STRING, --FIXME: should be '%String, fix when SBCL is fixed. + ['FUNCTION,['LAMBDA,['c],['CODE_-CHAR,'c]]],expandToVMForm x] expandStr2bytevec ['%str2bytevec,x] == - ['COERCE,expandToVMForm x,quoteForm ['%Vector,'%Byte]] + ['MAP,quoteForm ['%Vector,'%Byte], + ['FUNCTION,['LAMBDA,['c],['CHAR_-CODE,'c]]],expandToVMForm x] -- bit vector operations expandBitvecnot ['%bitvecnot,x] == -- cgit v1.2.3