[squeak-dev] #<-

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Dec 16 15:14:35 UTC 2019


I use associations with #-> quite often - for example, with Dictionary class >> #newFrom::


Dictionary newFrom: {1 -> #one. 2 -> #two}


In Contrast to #at:put:, the above version checks that each key is unique.


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Levente Uzonyi <leves at caesar.elte.hu>
Gesendet: Montag, 16. Dezember 2019 15:52:12
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] #<-

I think #-> was not a good idea. I personally use it fairly rarely, and
it's just a shorthand variant of Association>>key:value:.
It was probably more useful when brace arrays were not part of the
language, but I find the latter way superior for creating tuples.

Levente

On Mon, 16 Dec 2019, Thiede, Christoph wrote:

>
> Hi, thanks for your arguments!
>
>
> I think that #<- would be symmetric to #->, such as #< and #>, etc. ...
>
> Another example would be [Dictionary newFrom: {1 <- #one. 2 <- #two. 3 <- #three}], but I agree, readability is quite subjective here.
>
>
> From my point of view, Stef, implementing #<- with a completely different meaning would be confusing. I guess this depends on your specific domain.
>
>
> @Jakob:
>
> > Sometimes I think one should separate Smalltalk the programming language from Smalltalk as a scripting language (in Vivide or your spreadsheets, Christoph). I find such brevity cool for the latter but I despise it for the
> former.
>
>
> Interesting statement! From a scripting perspective, it would be great to have a maximum number of convenient utils. However, I find it always confusing when you start building a solution via scripting and then need to
> rephrase your code because scripting syntax is not available for real programs. This compromises the idea of the One Uniform Smalltalk.
>
> Best,
> Christoph
>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von tim Rowledge <tim at rowledge.org>
> Gesendet: Sonntag, 15. Dezember 2019 19:59:19
> An: The general-purpose Squeak developers list
> Betreff: Re: [squeak-dev] #<-
>
>
> > On 2019-12-15, at 3:38 AM, Jakob Reschke <forums.jakob at resfarm.de> wrote:
> >
> > Sometimes I think one should separate Smalltalk the programming language from Smalltalk as a scripting language (in Vivide or your spreadsheets, Christoph). I find such brevity cool for the latter but I despise it for the
> former.
>
> Also +1. What next -
> 1 value: 4 value: 'two'
> being handled by converting the 1 to #one, sending #isKindOf: to the second arg and then coercively converting the first argument to a compatible class via an indirection dictionary provided by a database lookup from the
> receiver?
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Useful random insult:- Ought to have a warning label on his forehead.
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191216/5c316268/attachment.html>


More information about the Squeak-dev mailing list