Smalltalk syntax can rule them all

This is a discussion on Smalltalk syntax can rule them all within the Smalltalk forums in Programming Languages category; >>>>> "Ed" == Ed Prochak <edprochak @ gmail.com> writes: Ed> On Jul 21, 1:20 am, paolo.bonz...@gmail.com wrote: >> > rather than saying something like >> >> > output := '<html><head>... </head><body> ... </body>' . >> >> > we can more simply say: >> >> > output := >> > [HTML >> > addComponent: [HEAD ... ] >> > addComponent: [BODY ... ] >> > ] >> >> this is more or less how you describe pages in seaside, actually. >> >> Paolo Ed> How are nested elements handled? Ed> <body>...<OL>...<LI>item <EM>one</EM>...</OL>...</body> html orderedList: [ html listItem: [ html text: 'item ...

Go Back   Application Development Forum > Programming Languages > Smalltalk

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #11  
Old 07-23-2008, 03:10 PM
Randal L. Schwartz
Guest
 
Default Re: The Builder Pattern to rule them all Re: Smalltalk syntax can rule them all

>>>>> "Ed" == Ed Prochak <edprochak@gmail.com> writes:

Ed> On Jul 21, 1:20 am, paolo.bonz...@gmail.com wrote:
>> > rather than saying something like

>>
>> > output := '<html><head>... </head><body> ... </body>' .

>>
>> > we can more simply say:

>>
>> > output :=
>> > [HTML
>> > addComponent: [HEAD ... ]
>> > addComponent: [BODY ... ]
>> > ]

>>
>> this is more or less how you describe pages in seaside, actually.
>>
>> Paolo


Ed> How are nested elements handled?
Ed> <body>...<OL>...<LI>item <EM>one</EM>...</OL>...</body>

html orderedList: [
html listItem: [
html text: 'item '.
html emphasis: 'one'.
].
].

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Reply With Quote
  #12  
Old 08-05-2008, 01:36 AM
Panu
Guest
 
Default Re: The Builder Pattern to rule them all Re: Smalltalk syntax canrule them all

OK, cool,

I didn't know Seaside that well.

I think what's noteworthy, since
it's not immediately apparent from
the code examples, is that these
examples are LAZY EVALUATING.

The inner block (is/can) be evaluated
later - I believe, at least in my
implementation, at the point in time
when the block-structure needs to be
accessed, because a request is made to
render it as HTML etc.

This may not sound as a big thing
to begin with. But once you start
playing with it you realize that
at the point when a child-node-block
is evaluated, it can take into account
the current state of evaluation
of the whole tree.

This leads to all kinds of interesting
possibilities including the fact that
a child-node can have access to all
its ancestor-nodes, and their properties,
and can include conditional logic to
create its own attributes based on
the attributes of the containers.

I think in the end this will blow
the socks off any static markup
languages, such as HTML, XML etc.
And what's most noteworthy is that
Smalltalk (+ some other minor languages
like Lisp) have the syntax to support it
already.

Whatever XML is good for, Smalltalk
is as good and better, it seems.

-Panu Viljamaa



Randal L. Schwartz wrote:
>>>>>> "Ed" == Ed Prochak <edprochak@gmail.com> writes:

>
> Ed> On Jul 21, 1:20 am, paolo.bonz...@gmail.com wrote:
>>>> rather than saying something like
>>>> output := '<html><head>... </head><body> ... </body>' .
>>>> we can more simply say:
>>>> output :=
>>>> [HTML
>>>> addComponent: [HEAD ... ]
>>>> addComponent: [BODY ... ]
>>>> ]
>>> this is more or less how you describe pages in seaside, actually.
>>>
>>> Paolo

>
> Ed> How are nested elements handled?
> Ed> <body>...<OL>...<LI>item <EM>one</EM>...</OL>...</body>
>
> html orderedList: [
> html listItem: [
> html text: 'item '.
> html emphasis: 'one'.
> ].
> ].
>

Reply With Quote
  #13  
Old 08-05-2008, 09:44 AM
Steven Kelly
Guest
 
Default Re: The Builder Pattern to rule them all Re: Smalltalk syntax can rule them all

"Panu" <panu@nospam.com> wrote in message
news:k4qdnTjmB77YdQrVnZ2dnUVZ_sWdnZ2d@totallyobjec ts.com...
> Whatever XML is good for, Smalltalk
> is as good and better, it seems.


How's about that for an example of "damning with faint praise"! :-)

Steve


Reply With Quote
  #14  
Old 08-23-2008, 09:07 PM
Mike Austin
Guest
 
Default Re: The Builder Pattern to rule them all Re: Smalltalk syntax canrule them all

Randal L. Schwartz wrote:
>>>>>> "Ed" == Ed Prochak <edprochak@gmail.com> writes:

>
> Ed> On Jul 21, 1:20 am, paolo.bonz...@gmail.com wrote:
>>>> rather than saying something like
>>>> output := '<html><head>... </head><body> ... </body>' .
>>>> we can more simply say:
>>>> output :=
>>>> [HTML
>>>> addComponent: [HEAD ... ]
>>>> addComponent: [BODY ... ]
>>>> ]
>>> this is more or less how you describe pages in seaside, actually.
>>>
>>> Paolo

>
> Ed> How are nested elements handled?
> Ed> <body>...<OL>...<LI>item <EM>one</EM>...</OL>...</body>
>
> html orderedList: [
> html listItem: [
> html text: 'item '.
> html emphasis: 'one'.
> ].
> ].


Question...

Why wouldn't you just use a templating mechanism instead of hand coded
psuedo-HTML? I would rather write my HTML in HTML:

<ol>
<li>${item} <em>${description}</em></li>
</ol>

template apply: data


Mike Austin
Reply With Quote
  #15  
Old 09-02-2008, 05:23 AM
Reinout Heeck
Guest
 
Default Re: The Builder Pattern to rule them all Re: Smalltalk syntax canrule them all

>>
>> html orderedList: [
>> html listItem: [
>> html text: 'item '.
>> html emphasis: 'one'.
>> ].
>> ].

>
> Question...
>
> Why wouldn't you just use a templating mechanism instead of hand coded
> psuedo-HTML? I would rather write my HTML in HTML:
>
> <ol>
> <li>${item} <em>${description}</em></li>
> </ol>
>
> template apply: data



Been there, done that -- it's a nightmare.

It mostly boils down to templates being 'dead code', you cannot do
'senders of' or 'references to variable' etc -- it makes development slower.

Hard coding the html generation but leaving the RSS free to be tweaked
by a design department appears to give a much more productive
responsibility split.


If you are not aware of the various 'heretical' Seaside design decisions
you may want to read some of the interviews Avi gave, like this one:

http://www.caboo.se/articles/2007/4/...ith-avi-bryant




R
-
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 11:15 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.