[Cuis-dev] [squeak-dev] Re: How can I add another collection syntax, such as {1} & #(1) & #[1]?

rabbit rabbit at callistohouse.org
Sat Aug 12 06:58:01 PDT 2023


Well, I see what you mean. I can just use the concat selector for ETuple #!! and not worry about Compiler changes. Whew!

I just pushed another version of Crypto-67 with the following changes:

> Added sugar #wrapAsNestedETuple. Use the following to construct ETuples with a nested ETuple as the first parameter. Note that the #printOn: prints the code needed to construct that same ETuple. So when you open an Inspector on an ETuple (particularly if the first Parameter is a nested ETuple) the resulting printString will be DoItable.
>
> ((1 !! 2 !!3) wrapAsNestedETuple !! #thisIsAConstructedWithNestingETuple)

It's all good with me! Hoping for you!
••• rabbit ❤️‍🔥🐰

On 8/12/23 09:28, rabbit wrote:

> Yessir, if you load Crypto-rabbt.66.mcz, from SqueakSource 'Cryptology', you can find my variant of a Linda Tuple, my ETuple. I'm using #!! to concat, as you say. My thoughts are with compilable code that creates such, as in the special Compiler selectors, #( and #[. I would want to add #< as yet another Compiler special.
>
> Cheers!
> ••• rabbit ❤️‍🔥🐰
>
> On 8/12/23 09:22, Luciano Notarfrancesco wrote:
>
>> I don’t know what an ETuple is, is is a kind of literal? I create tuples (a kind of array) with the message #,. For example, (1,2,3) sends ‘, 2’ to 1 and returns a tuple with 1 and 2, and then this tuple receives ‘, 3’ and returns a tuple with 1, 2 and 3. It’s not the most efficient way of creating tuples (it creates some temporary garbage), and they are not literals, but it makes very readable code.
>>
>> On Sat, 12 Aug 2023 at 20:10 rabbit via Cuis-dev <cuis-dev at lists.cuis.st> wrote:
>>
>>> I think it will need to be such as read-only Array and ByteArray construction, to differentiate from other selectors. So it will need to be #<. I'm fine with it being a read-only ETuple, so that it conforms to the convention of constructing read-ony objects :: #() . and #[]. I could sent #makeWriteableObject to. If a Tuple detects Computable, it could make itself Writeable, or when computations occur prior to replacing the computable with the result of computation. And so on and so forth. This would look as
>>>
>>>> #<#<1 !! 2 !! 3> !! #thisIsAConstructedWithNestingETuple>
>>>
>>> Best,
>>> ••• rabbit ❤️‍🔥🐰
>>>
>>> On 8/12/23 09:03, rabbit via Cuis-dev wrote:
>>>
>>>> Good morning. I wish to add <> brackets to create an ETuple. How may I accomplish this? Such as:
>>>>
>>>>> <<1 !! 2 !! 3> !! #thisIsAConstructedWithNestingETuple>
>>>>
>>>> Results in:
>>>>
>>>>> anETuple (2 elements :: {anETuple (3 elements :: {1 !! 2 !! 3}) !! #thisIsAConstructedWithNestingETuple})
>>>>
>>>> Gratefully,
>>>> ••• rabbit ❤️‍🔥🐰
>>>
>>> --
>>> ••• rabbit ❤️‍🔥🐰
>>>
>>> --
>>> Cuis-dev mailing list
>>> Cuis-dev at lists.cuis.st
>>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
> --
> ••• rabbit ❤️‍🔥🐰

--
••• rabbit ❤️‍🔥🐰
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230812/e5171dde/attachment.htm>


More information about the Cuis-dev mailing list