ZnHtmlOutputStream Attributes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ZnHtmlOutputStream Attributes

Sean P. DeNigris
Administrator
Any reason to pass as a flat collection of pairs rather than a collection of
associations or a dictionary? IMHO the former is less intention revealing
and potentially confusing…



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: ZnHtmlOutputStream Attributes

Sven Van Caekenberghe-2

> On 20 Sep 2017, at 20:36, Sean P. DeNigris <[hidden email]> wrote:
>
> Any reason to pass as a flat collection of pairs rather than a collection of
> associations or a dictionary? IMHO the former is less intention revealing
> and potentially confusing…

I probably did it because it was the least amount of typing.

Right now,

  html tag: #div attributes: #(class menu id one) with: 'Foo'.

generates

  <div class="menu" id="one">Foo</div>

Associations would indeed also work, like

  html tag: #div attributes: { #class->#menu. #id->#one } with: 'Foo'.

Since Dictionary>>#do: runs over Associations, a real dictionary would also work then.

It is still a bit more to type, but it is clearer.

Sven