Speed isn't the only problem (although I think it's a pretty serious 
one... Haml is already considerably slower than ERb). It's more or less 
impossible to parse nested brackets using only Regular Expressions, so 
something like "blah blah blah #{func {:arg => val}}," would break. 
Also, for the same reason, Haml has a longstanding (although apparently 
low-impact) bug where something like "%a{:href => person_url} Hi, } 
there!" will break... your syntax would break there, as well. The only 
way around this would be to build our own, pure-Ruby byte-by-byte 
parser, which would further increase the time taken. So it's really not 
feasible.

- Nathan

Jeffrey Hardy wrote:
>> But, I'd personally take a *few* ugly
>> inline instances in trade for clear and usable structure definitions.
>>     
>
> I don't see this as a either/or problem. Ugliness must be rooted out.  
> The inline capabilities of Haml are sadly lacking, and it's forced me  
> to write some pretty ugly constructs. Not unlike Nathan's example:
>
> %p
>    I went to the
>    - succeed ',' do
>      = shops
>    so crossed the road
>
> I mean, come on. That's ugly. It's not Nathan's fault; there's just  
> no elegant way to do this in Haml. I've been forced to perform  
> similar view vandalism in much the same vein. And it hurts me. Haml  
> is about beauty. (Haml is also about structure. I contend that ugly  
> hanging constructs that are begging to be compacted make it difficult  
> to read and work with the structure).
>
> Why not interpret #{} embedding tags anywhere in non-evaling lines,  
> much in the same way that ERb allows <%= %>?
>
> I understand that scanning each line of the template looking for  
> embedded code will result in a performance hit, but I say 'meh'. I'd  
> rather have a speed decrease I'd never notice than ugly templates I  
> have to look at every day. (Besides. I've never found Haml to be  
> slow. Ever. Even in its pre-release days, before compilation support  
> was added. If your app is slow, Haml's render time is hardly the  
> bottleneck).
>
> So, anyways, am I the only one who thinks the following looks much  
> better?
>
> %p I went to the #{shops}, so crossed the road.
>
> %blockquote
>    I think that #{features[:inline_embedding]} would be a fabulous
>    idea that would surely bring about world peace. Please read my
>    crappy #{link_to 'blog', 'http://example.com'}, friend.
>
>
>
> /Jeff
>
>
> --
> Jeffrey Hardy (packagethief)
> http://unspace.ca
> http://quotedprintable.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to