[Cuis-dev] Language constructs

Juan Vuletich juan at jvuletich.org
Fri May 1 07:50:25 PDT 2020


On 5/1/2020 5:56 AM, Erik Stel via Cuis-dev wrote:
> Hi Luciano,
>
> I agree, we can’t live (happily ;-) without Character, Symbol, Number 
> and String literals. It would be very annoying to create instances 
> without the existing literal declarations.
>
> I think we have the same feeling regarding {}, did not use it, but it 
> makes code more readable in some places. Although I tended to use 
> lazy initialised (class or instance) variables to create the instances 
> I needed. I have the feeling it is more clear I am constructing an 
> Array in that way. Since I do see code in which Arrays are constructed 
> using {} which actually are more like Sets, namely to describe the set 
> of possible/allowed values. It is then used to validate inclusion of 
> an element within this …Array?! But the fact that an element has an 
> index is not relevant. Maybe…just maybe…{} should have been used to 
> create a Set instead of an Array. Seems more similar to the 
> mathematical notation we used at school ;-).
>
> Thx for your insight!
> Erik
>

As I said in another message, `{ 1. 3. 5. 7. 11. 13} asSet` looks like a 
good alternative to me.

>> On 1 May 2020, at 10:19, cuis-dev-request at lists.cuis.st 
>> <mailto:cuis-dev-request at lists.cuis.st> wrote:
>>
>> I haven’t used backticks, because in the cases that I could have used 
>> them the performance gain was negligible, and I’m constantly 
>> refactoring and changing everything so I was afraid that they might 
>> introduce weird bugs (because old instances could linger inside 
>> compiled methods).
>>
>> Maybe I could live without #(), I don’t use it that much. I’m not 
>> sure it is important for the base system, tho. Same goes for $. 
>> However, symbol literals are important, and I can’t imagine coding 
>> without literals for numbers and strings, it is possible but must be 
>> very annoying.
>>
>> I like {} and use it often. It is relatively new, I used to code 
>> without it, and at the beginning I didn’t like it but ended up 
>> getting used to it. It does make code more readable.
>>
>> On Fri, 1 May 2020 at 2:46 PM, Erik Stel via Cuis-dev 
>> <cuis-dev at lists.cuis.st <mailto:cuis-dev at lists.cuis.st>> wrote:
>>
>>     Maybe I wasn’t clear (because it was part of another topic, see
>>     below) or tread on a sensitive subject, but I’m still eager to
>>     hear the reasoning for having backticks (which are not in Squeak
>>     nor Pharo) from the simplicity point of view. Would anyone care
>>     to elaborate?
>>
>>     I am also eager to know what others think about language
>>     constructs such as #(), {} and `` for daily usage. And I mean
>>     this in the sense ‘Do you use these often? Could you live without
>>     them?’. I do understand how they can be used and what their
>>     meaning is ;-). And I can also lookup their current use in the
>>     default image, but that does not answer how you/we use them in
>>     our (application) code.
>>
>>     Kind regards,
>>     Erik
>>
>>
>

Cheers,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200501/52cfc1cf/attachment.htm>


More information about the Cuis-dev mailing list