PROPOSAL: Templated Construction Expressions (i.e., Expressions Embedded in Strings)

rssh at gradsoft.com.ua rssh at gradsoft.com.ua
Wed Apr 1 00:16:19 PDT 2009


>
> On Mar 30, 2009, at 10:37 PM, rssh at gradsoft.com.ua wrote:
>
>>> On Mar 20, 2009, at 1:50 PM, John Rose wrote:
>>>
>> 3. COMPABILITY - this breaks all code with use $ in string literals.
>> (Or I
>> read something incorrectly ?)   So better prefix such string with
>> something. (may be yet one '$' or '@' ?)
>
> You read incorrectly.  Template constructor expressions are distinct
> from string literals.  They are prefixed with the token "new".
>

 Thanks, I reread you proposal and see that I missed too many during first
reading.

 With explicit compile, I see that - we already have analogical JSR223
mechanism in language, which would be nice to reuse.

>> 4. Why just not call this parser from some method ?  I. e. what
>> arguments
>> for including string templates in language itself, instead library
>> call ?
>
> The usual:  Sugar like that can help API designers build APIs whose
> code is more maintainable:  Less noisy.  Template-based systems are
> popular for a reason.
>

This would be difference between

new "template-text"

and

new MyCompiler("template-text")

// i. e. main magic is in assigned template-expression to appendable.

Thanks, now I understand.
   Hope will be change implement this in (E x: x>=7): Java x


> -- John
>





More information about the coin-dev mailing list