I think the compiler would be far exceeding its job description if it was
trying to identify the language of every string! This sounds like it would
be better as part of a separate validation tool.

And of course, there's no telling when (if?!) string interpolation gets
added to the language. Right now we are stuck with (++) and concat.

On Mon, Aug 1, 2016 at 1:35 AM, Peter Damoc <[email protected]> wrote:

> I agree with Zach.
>
> "I know what I'm doing" is sometimes a shorthand for "WTF was I thinking 6
> months ago?". Just because it makes sense to you now it is not a guarantee
> that will continue to make sense forever.
>
> If you like to shoot yourself in the foot, Elm does not try to prevent you
> but it doesn't give you any gun either. You'll have to bring your own gun
> (JS). :)
>
>
>
>
>
> On Mon, Aug 1, 2016 at 10:34 AM, Zachary Kessin <[email protected]> wrote:
>
>> I dislike the idea of any syntax that will let me do something dumb and
>> let me "Fix it later" because that generally never happens
>>
>> Zach
>> ᐧ
>>
>> On Sun, Jul 31, 2016 at 11:15 PM, Filip Haglund <[email protected]>
>> wrote:
>>
>>> Keeping with the helpfullness of the compiler, having warnings when
>>> doing scetchy things with string interpolation (issue #905 on Github
>>> <https://github.com/elm-lang/elm-compiler/issues/905>) could be useful.
>>> This could be warnings about building urls's from variables that might be
>>> user input. It could also be about building SQL queries, or HTML.
>>>
>>> I suggest having some basic checks in the compiler for these areas where
>>> special care should be taken. This would generate warnings, assuming it is
>>> a mistake until proven otherwise.
>>>
>>> `"http://example.com/profile/{{userdata}}/"` would generate a warning.
>>> `"http://example.com/profile/{{[url] userdata }}/"`would not.
>>>
>>> `"My name is {{[url] userdata}}."`would generate a warning.
>>> `"My name is {{userdata}}."`would not.
>>>
>>> `"Check out my <a href='://example.com/{{[html]
>>> <http://example.com/%7B%7B%5Bhtml%5D> userdata}}/blog'>blog</a>."`
>>> would generate a warning.
>>> `"Check out my <a href='://example.com/{{[url]
>>> <http://example.com/%7B%7B%5Burl%5D> userdata}}/blog'>blog</a>."` would
>>> generate a warning.
>>> `"Check out my <a href='://example.com/{{[html
>>> <http://example.com/%7B%7B%5Bhtml>, url] userdata}}/blog'>blog</a>."`
>>> would not.
>>>
>>> `"Select * from users where username = '{{userdata}}'"` would generate a
>>> warning.
>>> `"Select * from users where username = '{{[html, url] userdata}}'"`
>>> would generate a warning.
>>> `"Select * from users where username = '{{[sql] userdata}}'"` would not.
>>>
>>> Exact syntax is not important right now. I want to know what the
>>> community thinks about the idea of "I know what I'm doing"-annotated string
>>> interpolation.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Elm Discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Zach Kessin
>> SquareTarget <http://squaretarget.rocks?utm_source=email-sig>
>> Twitter: @zkessin <https://twitter.com/zkessin>
>> Skype: zachkessin
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Elm Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to