Re: [Jolie-devel] Jolie 1.2 - Inline trees
A service-oriented programming language.
Brought to you by:
fmontesi
From: Matthias D. W. <mwa...@ya...> - 2015-03-14 08:17:48
|
We could also try to imitate "with", which requires the semicolons, but its block content is also not limited to assignments. > with ( animals ){ > .pet[ 0 ].name = "cat"; > .pet[ 1 ].name = "dog"; > println@Console(.pet[0].name)(); > .wild[ 0 ].name = "tiger"; > .wild[ 1 ].name = "lion" > } Saverio Giallorenzo schrieb: > If I may toss an idea, what about making the syntax of inline trees as > close al possible to that of type declaration? > > E.g., we have type > > type myType: string { > .x[ 1, * ]: int > .y[ 1, 3 ]: void { > .value*: double > .comment: string > } > } > > and we write > > myTree << "Root" { > .x[0]=1 > .x[1]=2 > .y << { > .value[0]=1.1 > .value[1]=2.1 > .value[2]=3.1 > .comment = "This is a comment" > } > } > > Granted a comma does not make such a big difference, as an user I would > wander why one syntax needs the comma and the other does not. > > BTW, should the deep-copy operator work inside inline trees or shall we > allow only assignments? > > Best, > sg > > > On 12 March 2015 at 10:10, Matthias Dieter Wallnöfer > <mwa...@ya... <mailto:mwa...@ya...>> wrote: > > ";" is more about sequential execution for us, "," is our delimiter > (consider also "for") so I would stuck with ",". > > Matthias > > > Fabrizio Montesi <fam...@gm... <mailto:fam...@gm...>> > schrieb am 9:30 Donnerstag, 12.März 2015: > > > > Hi all, > > Any ideas on my last comment in the e-mail (comma vs semi-colon)? > I'd like some feedback on that particular syntax before making it > official on the docs site. > > Even an "I like it" would make me feel better. Break the silence. ;-) > > Cheers, > Fabrizio > > > On Sat, Mar 7, 2015 at 3:44 PM, Fabrizio Montesi > <fam...@gm... <mailto:fam...@gm...>> wrote: > > Hi all, > > > >I committed a series of patches I had lingering around for a while > on inline trees. > > > >Now we can write stuff like this: > > > >a.left << "Left" { .x = 1, .y = 2, .y.left = "y_l", .y.right = "y_r" }; > > > > > >valueToPrettyString@StringUtils( { .x = 1, .y = 2 } )( s ); > > > > > > > > > >This is obtained by introducing a new kind of expression > (InlineTreeExpression) that takes a value for the root node and a > series of assignments in between curly brackets { }. > > > > > >You can thus write an inline tree wherever you can write an expression. > > > > > >Let me know what you think. > > > > > >In particular, I tried to follow what they do in other language by > using the comma to separate assignments, but I'm not very happy that > it is inconsistent with what we do in protocol configurations where > we use ; instead. > > > > > >Feedback is welcome. > > > > > >Cheers, > >Fabrizio > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, > sponsored > by Intel and developed in partnership with Slashdot Media, is your > hub for all > things parallel software development, from weekly thought leadership > blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > > _______________________________________________ > Jolie-devel mailing list > Jol...@li... > <mailto:Jol...@li...> > https://lists.sourceforge.net/lists/listinfo/jolie-devel > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, > sponsored > by Intel and developed in partnership with Slashdot Media, is your > hub for all > things parallel software development, from weekly thought leadership > blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Jolie-devel mailing list > Jol...@li... > <mailto:Jol...@li...> > https://lists.sourceforge.net/lists/listinfo/jolie-devel > > |