Roelof,
I don't think so.
A Class cannot access instance variables. Why? because a Class doesn't
know which of its instances to ask for it.
Ask yourself: who is "self" in a Class method? Is it the Class or is it
an individual instance of the Class?
(Hint: in a Class, #self is the Class, whil
--- Begin Message ---
Hello,
I have now a challenge where I have to validate a ISBN number.
Can I do something like this on the class side :
(string isEmpty)
ifTrrue: [ ^ false]
ifFalse: [ digits:= something.
controlDigit := something.
self validateIS
Richard Sargent is giving good advice that you cannot use in Exercism.
Your code MUST pass the exercism tests and that means it MUST NOT
limit the hour or minute ranges.
On Tue, 1 Sep 2020 at 08:58, Roelof Wobben via Pharo-users <
pharo-users@lists.pharo.org> wrote:
>
> I would argue against tha
Roelof explicitly said that this is for an Exercism exercise.
That exercise defines the API (implicitly) in the test cases.
Roelof has no choice about what the API is, his job is just
to make the tests pass. Your ideas about how to design an
API are good ones, it's just that Exercism says what to
I have always found it annoying that the exercism specifications
do not spell things out, so you HAVE to read the tests to find out
what you are supposed to do, which pretty much spoils the point of
them BEING tests.
In this case, we note that there is a test case where the number
of hours is 100,
Hi,
Indeed, we have an integration for OpenCV here:
https://github.com/feenkcom/gt4opencv
Cheers,
Doru
> On Aug 31, 2020, at 4:14 PM, Stéphane Ducasse
> wrote:
>
> I know that there is an openCV binding by https://twitter.com/DmitryMatveev
> You have a binding in GT too.
>
>
>> On 31 Au
--- Begin Message ---
Op 1-9-2020 om 21:40 schreef Roelof
Wobben:
Op
1-9-2020 om 21:11 schreef Richard Sargent:
You will discover an error when you write
your tests, but that's fine. It's why you write tests. :-)
#valida
--- Begin Message ---
Op 1-9-2020 om 21:11 schreef Richard Sargent:
You will discover an error when you write your tests, but that's fine.
It's why you write tests. :-)
#validateTime:minute: is a poor name choice for a few reasons.
- there is no validation going on. Validation would report an e
What is the value of *self* when the error occurred? The debugger should
show you this.
Another way to determine this is to look at the code and think about where
the sending method is implemented and where the invoked method is
implemented (assuming that there really is one).
On Tue, Sep 1, 202
--- Begin Message ---
oke, then I would work with hour and minutes as the challenge
wanted,
So still on the class side make code that convert any
given hour and minute to a valid one ?
Hi john you can propose for inclusion in pharo.
- Add a nice comment (with executablecomments would be a plus).
- Possibly some tests
- Send a PR.
> On 1 Sep 2020, at 09:32, John Aspinall wrote:
>
> Dolphin shows the same behaviour. I added the following method to
> ScaledDecimal to help:
>
Hi John,
I was doing a similar rounding in the test assertion, I think your
method is better and broadly usable (and maybe convenient for an
#equals: implementation).
Thanks!
Esteban A. Maringolo
On Tue, Sep 1, 2020 at 4:33 AM John Aspinall wrote:
>
> Dolphin shows the same behaviour. I added
It evaluates to false in VW too.
I guess it is a matter of internal representation, since
ScaledDecimals/FixedPoints are a Fraction after all.
What is weird, and I'd say wrong (at least from the UX perspective) is
that in Pharo (and Dolphin):
((91 - (2 * 35.9) - (0 / 2) * (113/121)) roundTo: 0.1
I recommend against modifying time instances once created. Likewise for
dates and timestamps.You don't know if the time instance has been shared
with another object. It's best to treat them as immutable once created.
Do not make the mistake of trying to avoid creating new objects. It will
lead to
Hi Stef,
That was the first thing I tried, but PharoADO (it is, PharoCOM) needs
the source in order to do some of its stuff.
But even so, I'd still like to have a VM that is used only for running
the image headless, without any GUI (nor IDE).
Regards!
Esteban A. Maringolo
On Mon, Aug 31, 2020
Dolphin shows the same behaviour. I added the following method to ScaledDecimal
to help:
roundedByScale
| scaleFactor |
scaleFactor := 10 ** scale.
^(ScaledDecimal newFromNumber: (fraction * scaleFactor) rounded scale:
scale) / scaleFactor
Translating slightly for Ph
16 matches
Mail list logo