2011/7/18 Stéphane Ducasse <stephane.ducasse@inria.fr>
Why do you say so ? I can fileOut, then fileIn without a problem. To me, this is not a bug. This is a feature. Source ! are doubled so as not to be confused with chunk separators, it's an escaping sequence like doubles quotes in String
'here''s another example which is not a bug'
this is not because people were not using a decent syntax to fileout and that after they hacked the system that this is not a bug.
Yes, it is by no way meant to be human written and does not decently meet the requirements for scripting. For exchanging code, the chunk format is a bit poor too, but it is manageable with a good change list tool (not the squeak one). And remember, it was (and is still) used for logging system changes in the change log. And it is very efficient for that. With chunk format, you don't need quoting the code (except exclamation mark itself of course), and that's an important feature IMO, this format served its purpose very decently. Well, you can tell me the Squeak hacks to identify authors and timestamp are awfully implemented, I can only agree, but the basis are very simple. TSTTCPW. If you save a method and once it is saved you cannot load it back then what
is the point to save it.
But you can. You can browse the code, can't you ? go and see in .sources or .changes, you'll see a doubled ! You can fileOut, then fileIn, no problem.
Seriously this is not the same than with double quote.
I don't agree
Else it means that you cannot/should not use $! in Smalltalk method. And I read most of the spec and books on smalltalk and nobody ever mentioned that. Here this is just that this is doing the wrong behavior.
Right, they don't mention a problem because there is no problem. There is no problem because the ! is handled by doubling so as to not confuse it with an end of chunk mark.
Nicolas
Imagine that we save the code using the coral syntax then what we would not use [] anymore in method?
Stef
Nicolas
2011/7/18 Stéphane Ducasse <stephane.ducasse@inria.fr> Yes I know. To me, saving a method should make sure that we can reload it and this is
not the case.
So to me this is a bug.
try to fileout
getPreambleFrom: aFileStream at: position | writeStream | writeStream := String new writeStream. position to: 0 by: -1 do: [ :p | | c | aFileStream position: p. c := aFileStream basicNext. c == $! ifTrue: [^ writeStream contents reversed] ifFalse: [writeStream nextPut: c]]
:)
I do not see why the system should not save it correctly even if !! is used as a chunk separator.
Stef
On Jul 18, 2011, at 4:55 PM, Lukas Renggli wrote:
!! Is the escaping of a single ! (like '' is the escaping of ' in a string), because the ! Is used to separate junks.
Lukas
On Monday, 18 July 2011, stephane ducasse <stephane.ducasse@free.fr> wrote:
Hi
with veronica we found a fun bug. If you have a method with a $! and you file it out. you get $!! in the fileouted file.
http://code.google.com/p/pharo/issues/detail?id=4531
Stef
-- Lukas Renggli www.lukas-renggli.ch