File out error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

File out error

Robin Redeker-2
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
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: File out error

S11001001
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.nocandysw.com/blog


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: File out error

Paolo Bonzini
In reply to this post by Robin Redeker-2

> 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
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk