Re: [Freemarker-devel] Ideal tag syntax; what's your take on it?
Daniel Henrique Alves Lima <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user,gmane.comp.web.freemarker.devel |
|---|---|
| Message-ID | <[email protected]> |
Daniel Dekany wrote:
>>>
>>>
>> <img src="${createLinkTo dir:'images', file:'logo.jpg'}" />
>>
>> <img src="${createLinkTo file:'images/logo.jpg'}" /> (it's not a syntax problem)
>>
>>
>> ?
>>
>
> You mean parenthesisless calls? Those can look cute, but they have a
> great potential to cause headaches for the language designer (or for
> the user). Like, this:
>
> ${foo -1}
>
> Does it mean `${foo(-1)}` or `${foo - 1}`? Or even is `${foo}` a
> method call or just printing the value of foo? (Typical quick answer:
> Let's check the runtime type of `foo`, and if it's a callable...
>
I agree. It should be unambiguous.
${foo: 1} is an option for a method call, but this can clash with a map
literal(?)
${foo} printing value
${foo:} method call?
${foo - 1} = foo - 1
${foo: -1} method call
But
${foo: [a: 12, b: 3]} // [a: 12, b: 3] is a map literal
${foo: param1: 12, param2: 13}
Is 'param1: 12' a function call or a named arg?
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev