List Info

Thread: File out error




File out error
user name
2006-10-24 05:40:00
Hi,

i'm new to smalltalk (and gst), and i stumbled accross a bug
in file
out/file in (or to be more precise in
String>>storeOn.

The ending $' doesn't seem to be written out to the stream,
resulting in
something like this:

   "Filed out from GNU Smalltalk version 2.2b on
24-Oct-2006  7:19:26"!

   !BLOX.BLOXBrowser.NamespaceBrowser methodsFor: 'namespace
list blue button menu!
   addSubNamespace: listView
      | newNamespace |
   ...

String>>printOn: seems to get it right.

I'm using gnu smalltalk 2.2b on a
Linux elmex2 2.6.17.8 #2 Sun Sep 24 21:31:08 CEST 2006
x86_64 GNU/Linux.

Looking at String>>storeOn: i'm a bit puzzled about
the ''' copy':

   storeOn: aStream
       "Store Smalltalk code compiling to the receiver
on aStream"
       aStream nextPut: $'.
       self do:
       ⋅   [ :char | char == $' ifTrue: [ aStream
nextPut: char ].
   ⋅           ⋅     aStream nextPut: char ].
       self isReadOnly ifFalse: [ aStream nextPutAll: '''
copy' ]
   !

There seems to be missing a "ifTrue: [ aStream nextPut:
$' ]" or something like that.

cu,
Robin


_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk
File out error
user name
2006-10-24 07:21:51
Robin Redeker wrote:
> Looking at String>>storeOn: i'm a bit puzzled
about the ''' copy':

Your diagnosis further down looks right, but fyi:

st> (Array withAll: ''' copy') printNl!
($' $  $c $o $p $y )

-- 
Stephen Compall
http://scompall.no
candysw.com/blog


_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk
File out error
user name
2006-10-24 08:45:53
> Looking at String>>storeOn: i'm a bit puzzled
about the ''' copy':
>
>    storeOn: aStream
>        "Store Smalltalk code compiling to the
receiver on aStream"
>        aStream nextPut: $'.
>        self do:
>        ⋅   [ :char | char == $' ifTrue: [ aStream
nextPut: char ].
>    ⋅           ⋅     aStream nextPut: char ].
>        self isReadOnly ifFalse: [ aStream nextPutAll:
''' copy' ]
>    !
>
> There seems to be missing a "ifTrue: [ aStream
nextPut: $' ]" or something like that.
>   
Right.  BTW, the idea of 'copy' is to remove the read-only
flag that is 
set on string literals.

Thanks,

Paolo


_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )