2016-09-14 21:24 GMT+02:00 stepharo <stepharo@free.fr>:

Hi nicolai

Why we should not accept

foo
�� �� <func: (3+4) res:0>
�� �� ^ self

and be forced to put around ''

foo
�� �� < func: '(3+4)' res: 0 >
�� �� ^ self

I understand that we store literal but why you do not like it :).

First of all, the old compiler did not accept this. And I am a bit sensitive about changes, we allow a different syntax
just because RB happens�� to allow this (and maybe no one knows why or it just does not happens on purpose).

valid point.

And another reason, even without my fix, if we don't put quotes around that expression, the reformatting the source will convert this to:

foo
������ <func: #(3 #+ 4) res: 0>
������ ^ self
What I noticed is that I could not write

��foo
������ <expr: 3 + 4 result: 7>

but it worked when I put () so I did it in the new code I wrote.

And, even if (3+4) looks like an expression, it is just a list of literals something like this:

foo
������ <func: ([[[}}}) res:0>
������ ^ self

would be allowed too.
This one is ugly

But of course this is only my own opinion :)

We can change it back and maybe add support for the reformatter to not convert it to the literal array #(3 #+ 4) .

I do not know in fact this is why I asked :)
Now may be my idea to use pragma to get something like pythondoctest is a bad idea
but I really want to have literal programming.
What do you think?

So, until know, I didn't really know what pythondoctest is about.�� I first thought the "test" is about unit tests
and thought our way how we can generate or jump from methods to the corresponding is better,
but know I understand that it is about "perform regression testing by verifying that interactive examples are working"
And that is of course a good idea.

��

If we have ' ' then it would be good that the syntax higlighter works with a special mode inside the ' '

Not for pragma arguments, I think this would be confusing.

I did some expreiments with formatting code in comments. I 'll write shortly about it.


nicolai



Stef


�� 60220
19086 do not allow expressions as pragma arguments
�� �� �� �� https://pharo.fogbugz.com/f/cases/19086