[Cuis-dev] Array evalStrings
Todd Blanchard
tblanchard at mac.com
Thu Feb 8 19:49:51 PST 2024
I apologize, I meant no disrespect. Apparently my writing style is overly direct. Lifelong problem.
I kind of fundamentally object to explicit tests of class because it makes for brittle code. We had one kind of String class and there was code that tested to see if an instance was of class String. Then we added another kind of String class and the code stopped working in some cases. To me, that is brittle. If we instead rely on polymorphic test methods like isString, the client code is more robust.
Attached is how I would write evalStrings using isSymbol, isString, and isArray.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6157-CuisCore-ToddBlanchard-2024Feb08-16h44m-tb.001.cs.st
Type: application/octet-stream
Size: 1194 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240208/c912611e/attachment.obj>
-------------- next part --------------
> On Feb 8, 2024, at 4:34?PM, Juan Vuletich via Cuis-dev <cuis-dev at lists.cuis.st> wrote:
>
> Folks, in general, I expect a friendlier tone. These last couple of days it seems we are starting to loose our manners.
>
> Todd, please check the _actual_ code in Cuis, and post a change set with your suggestions. Contributions are always welcome.
>
> In general, people, if you want to engage in discussion, please try to use a tone that will make others want to actually answer to your messages.
>
> Thanks,
>
> On 2/8/2024 7:26 PM, Todd Blanchard via Cuis-dev wrote:
>> Really? I thought explicit checking for class types was an anti pattern.
>>
>> The fact that this was a problem demonstrates that it is brittle.
>>
>> Seems a test for isString would be more future proof.
>>
>> Similar for Array, why would OrderedCollection not be acceptable?
>>
>>
>>> On Feb 6, 2024, at 8:04?AM, Juan Vuletich via Cuis-dev<cuis-dev at lists.cuis.st> wrote:
>>>
>>> On 2/4/2024 7:54 PM, Barry Perryman via Cuis-dev wrote:
>>>> Hi All,
>>>>
>>>> I was playing around with the Life package and hit a bug when trying to run ?Experiment?? from the menu. It prompts for a number of cells and a resolution window size but fails when trying to read the x value from a point. The problem is the Array>>evalStrings doesn?t understand the UnicodeString passed into it.
>>>>
>>>> Attached is a change that checks for String or a UnicodeString.
>>>>
>>>> Barry
>>>>
>>> Integrated!
>>>
>>> Thanks,
>>>
>>> --
>>> Juan Vuletich
>>> cuis.st
>>> github.com/jvuletich
>>> researchgate.net/profile/Juan-Vuletich
>>> independent.academia.edu/JuanVuletich
>>> patents.justia.com/inventor/juan-manuel-vuletich
>>> linkedin.com/in/juan-vuletich-75611b3
>>> twitter.com/JuanVuletich
>>>
>>> --
>>> Cuis-dev mailing list
>>> Cuis-dev at lists.cuis.st
>>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
>
> --
> Juan Vuletich
> cuis.st
> github.com/jvuletich
> researchgate.net/profile/Juan-Vuletich
> independent.academia.edu/JuanVuletich
> patents.justia.com/inventor/juan-manuel-vuletich
> linkedin.com/in/juan-vuletich-75611b3
> twitter.com/JuanVuletich
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
More information about the Cuis-dev
mailing list