Pharo by example book: copying/pasting code snippets

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

Pharo by example book: copying/pasting code snippets

Andrei Stebakov
When I copy and paste code snippets from the book, the compiler complains about the minus signs (which is different character from what Pharo expects):

For example the line from the book:
(j > 1) ifTrue: [ (cells at: i at: j − 1) toggleState].
I have to change to (with "short" minus sign)
(j > 1) ifTrue: [ (cells at: i at: j - 1) toggleState].
Otherwise the method doesn't get accepted.
I wonder if this is a PDF issue and if it could be corrected?

Thank you,
Andrew


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pharo by example book: copying/pasting code snippets

Stéphane Ducasse
Hi andrei

this is a pdf issue. I suggest you to type the code this is the best way to learn.

Stef



On May 13, 2010, at 11:13 PM, Andrei Stebakov wrote:

> When I copy and paste code snippets from the book, the compiler complains about the minus signs (which is different character from what Pharo expects):
>
> For example the line from the book:
> (j > 1) ifTrue: [ (cells at: i at: j − 1) toggleState].
> I have to change to (with "short" minus sign)
> (j > 1) ifTrue: [ (cells at: i at: j - 1) toggleState].
> Otherwise the method doesn't get accepted.
> I wonder if this is a PDF issue and if it could be corrected?
>
> Thank you,
> Andrew
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pharo by example book: copying/pasting code snippets

Stefan Marr-4

On 13 May 2010, at 23:19, Stéphane Ducasse wrote:

>>
>> On May 13, 2010, at 11:13 PM, Andrei Stebakov wrote:
>>
>>> When I copy and paste code snippets from the book, the compiler complains about the minus signs (which is different character from what Pharo expects):
>>>
>>> For example the line from the book:
>>> (j > 1) ifTrue: [ (cells at: i at: j − 1) toggleState].
>>> I have to change to (with "short" minus sign)
>>> (j > 1) ifTrue: [ (cells at: i at: j - 1) toggleState].
>>> Otherwise the method doesn't get accepted.
>>> I wonder if this is a PDF issue and if it could be corrected?

> this is a pdf issue.
In my latex documents, using a lstlisting environment, this isn't a problem...
Tested on OS X.

Best regards
Stefan



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pharo by example book: copying/pasting code snippets

Douglas Brebner
In reply to this post by Andrei Stebakov
On 13/05/2010 22:13, Andrei Stebakov wrote:

> When I copy and paste code snippets from the book, the compiler
> complains about the minus signs (which is different character from
> what Pharo expects):
>
> For example the line from the book:
> (j > 1) ifTrue: [ (cells at: i at: j − 1) toggleState].
> I have to change to (with "short" minus sign)
> (j > 1) ifTrue: [ (cells at: i at: j - 1) toggleState].
> Otherwise the method doesn't get accepted.
> I wonder if this is a PDF issue and if it could be corrected?
>

Looks like the pdf is using the unicode minus character instead of the
ascii dash (which Pharo uses for minus) which are not the same.

I wouldn't like to argue about which is in the wrong here ;)


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pharo by example book: copying/pasting code snippets

Mariano Martinez Peck
In reply to this post by Stefan Marr-4


On Thu, May 13, 2010 at 11:35 PM, Stefan Marr <[hidden email]> wrote:

On 13 May 2010, at 23:19, Stéphane Ducasse wrote:
>>
>> On May 13, 2010, at 11:13 PM, Andrei Stebakov wrote:
>>
>>> When I copy and paste code snippets from the book, the compiler complains about the minus signs (which is different character from what Pharo expects):
>>>
>>> For example the line from the book:
>>> (j > 1) ifTrue: [ (cells at: i at: j − 1) toggleState].
>>> I have to change to (with "short" minus sign)
>>> (j > 1) ifTrue: [ (cells at: i at: j - 1) toggleState].
>>> Otherwise the method doesn't get accepted.
>>> I wonder if this is a PDF issue and if it could be corrected?

> this is a pdf issue.
In my latex documents, using a lstlisting environment, this isn't a problem...
Tested on OS X.

Best regards
Stefan



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project