Status: New
Owner: ---- Labels: Type-Bug New issue 6107 by [hidden email]: Double apostrophe '' doesn't resolve to ' on print it http://code.google.com/p/pharo/issues/detail?id=6107 Pharo1.4 Latest update: #14438 Windows XP Select 'Don''t panic' in Workspace, Print it, gives 'Don''t panic' not 'Don't panic' _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: Invalid Comment #1 on issue 6107 by [hidden email]: Double apostrophe '' doesn't resolve to ' on print it http://code.google.com/p/pharo/issues/detail?id=6107 That is the correct behavior. Double apostrophe is how apostrophes are escaped in Smalltalk. 'Don't panic' is not a valid string because it can't be parsed - if you didn't get an unmatched apostrophe error, it would send the message #t to the string 'Don', which it does not understand. If you view it in a UI, it will be what you expected. For example: TextMorph new contents: 'Don''t panic'; openInWorld. _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Comment #2 on issue 6107 by [hidden email]: Double apostrophe '' doesn't resolve to ' on print it http://code.google.com/p/pharo/issues/detail?id=6107 Sorry for being a bit obtuse, I should have given an example. I know that 'Don't panic' is not a valid string. I typed 'Don''t panic' into the Workspace, 'print it' returned 'Don't panic'. What I meant by the double apostrophe not resolving into a single apsotrophe is that the double apostrophe remained a double apostrophe! Your TextMorph example didn't work for me - the morph didn't appear. I've just read the section on LOCell in PBE - that worked. _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Comment #3 on issue 6107 by [hidden email]: Double apostrophe '' doesn't resolve to ' on print it http://code.google.com/p/pharo/issues/detail?id=6107 for the text morph: It most probably appears on the top right corner of your image :) (and pretty small, and text only) So there is the notion that whenever possible stuff that is printed is a valid Smalltalk expression :) again => http://lists.gforge.inria.fr/mailman/listinfo/pharo-users _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Comment #4 on issue 6107 by [hidden email]: Double apostrophe '' doesn't resolve to ' on print it http://code.google.com/p/pharo/issues/detail?id=6107 (1) Excuse my aging eyes :) The text morph did appear - at the extreme top left - and the double apostrophe was turned into a single apostrophe. But my bug report said nothing about a TextMorph problem - please try and reproduce the bug exactly as I reported it. (2) You can apply 'print it' to any text! Why not? Of course, Smalltalk should barf if it's an incorrect Smalltalk expression. 'Don''t panic' is a Smalltalk string, and, therefore, a correct Smalltalk expression. (3) 'print it' in Workspace (still) doesn't get rid of that dratted apostrophe(just tried it again after succesful TextMorph experiment...) To make sure (!), I inspected it, and it's revealed as a ByteString. Clicking on self in inspector shows 'Don''t panic' - the dratted doubled apostrophe still *seems* to be there. But there are only 11 elements, and one apostrophe, in the 1,2,3... variable list! So the string looks OK - something looks to be going wrong between 'print it' and the 'Workspace/inspector' display. _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Comment #5 on issue 6107 by [hidden email]: Double apostrophe '' doesn't resolve to ' on print it http://code.google.com/p/pharo/issues/detail?id=6107 It is not a bug, just the way Smalltalk works. (BTW, Camillo himself reported it as a 'bug' recently ;-) Print It (and the Inspector) will eventually invoke #printOn: which is peculiar for String as it uses #storeOn: which will produce a Smalltalk string with escaped/doubled quotes. That is how things are historically. What you are looking for is what #nextPutAll: does when given a String as argument. HTH, Sven _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Free forum by Nabble | Edit this page |