".{} foo" and its variants are bad style because they're essentially
"magic characters". Making div implicit when you're using "." and "#" to
create CSS-sensitive attributes makes sense, because the CSS attributes
tend to denote structural elements of a document, and a div is the most
common such element.
However, without CSS, "." and "#" lose all semantic meaning, becoming
essentially arbitrary shorthand for "%div". Haml is about semantics;
having arbitrary characters work as shortcuts just for the sake of them
being shortcuts is antithetical to that.
".{}" won't be deprecated, as it's not a feature. It's an error in Haml
syntax, even though it doesn't throw an error. In the next major release
of Haml, and maybe in incremental releases before that, it will throw an
error, so you certainly shouldn't use it.
I hope that answers your question.
- Nathan
ridcully wrote:
> On Mar 7, 3:11 am, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
>
>> The problem with the first case is that you're not properly creating the
>> attributes hash. It's a literal Ruby hash, so you use "=>" to associate
>> values with names.
>>
>
> of course you are right.. that's weird. sorry dumb question.
>
>
>> There already is an ERB filter (accessed by :erb, unsurprisingly), but
>>
>
> yes, this is what i meant, and what i tried to use.
>
>
>> at the moment, filters don't have the capability of accessing runtime
>> information about the template, and Ruby code evaluated in the :erb and
>> :ruby filters doesn't run in the current ActionView instance. This will
>> probably be changed in upcoming releases.
>>
>
> ok, thanks, that would be greate.
>
> also, could you please clarify why i shouldn't write .{:attribute =>
> "value"}? it does work at the moment, will it be deprecated in future
> releases?
>
> andi
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---