On Fri, Jun 30, 2017 at 11:03 AM, Stephane Ducasse <stepharo.self@gmail.com> wrote:
Hi

recently I started to read a book on machine learning and they
manipulate dictionary of dictionary. (So I started my own
implementation and I will switch to DataFrame).

Now it occurred to me that when we program complex objects we do not
need a compact literal syntax for our objects. But when we manipulate
data objects it is super handy.

I ended up doing a lot of

��self new
�� �� �� addRow: 'Claudia Puig'
�� �� �� withTaggedValues:
�� �� �� �� �� �� {('Snakes on a Plane' -> 3.5). ('Just My Luck' -> 3.0).
('The Night Listener' -> 4.5). ('Superman Returns' -> 4.0). ('You, Me
and Dupree' -> 2.5)}.

And I was not in the mood to write a class for the taggedValues and
writing a class would not have really help me.


Now we also have STON but STON is not yet part of the language
grammar. So we have to have an explicit conversion call.

STON fromString: 'Point[10,20]'

We were brainstorming with marcus and we could have a first nice extension:

{ 'x' -> 10 .'y' -> 20 } asObjectOf: #Point.
>>> 10@20

Now in addition I think that there is a value in having an object
literal syntax.

I pasted the old mail of igor on object literals because I like the
idea since it does not add any change in the parser.
Do you remember what were the problem raised by this solution (beside
the fact that it had too many # and the order was like in ston not
explicit).

I would love to have another pass on the idea of Igor.



���Thank you St��phane for having this kind of discussion.
This is quite important to have a compact literal notations for tables or dataframes in Pharo,
if we want to be able to manipulate data like they are doing in Python or R.

I'm not sure we should have a literal notations for all kind of objects.

--
Serge Stinckwich
UCN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/