On Tue, Aug 26, 2014 at 3:18 AM, Zaxebo Yaxebo <
zax...@gmail.com> wrote:
> single " and single ' are very normal to occur in a single large multiline
> string.
> Even "MINIMALIST" ELEGANT LANGUAGE PYTHON also support triple quotes for
> multiline string.
Please refrain from statements like this in the future, or someone
(quite possibly me) will take the flame bait.
> support for "multiline escaped interpolation string" and "unescaped+without
> interpolation string" and custom interpolators on string - may be built in
> haxe
> I had requested this as
https://github.com/HaxeFoundation/haxe/issues/3276
> and
https://github.com/HaxeFoundation/haxe/issues/3276 , but unfortunately
> it was denied.
>
> haxe users are asking for this feature in haxe since year 2009.
> I would humbly request to kindly reconsider the decision and implement this.
>
> If needed I am ready to pay a humble contribution of upto "USD 100 dollars"
> as development cost of issue #3276 and issue #3277
> ==============
> right now we have to go for "haxe-m4" to achive this, but that makes it
> unintelligible for haxe editors for syntax colouring, due to an additional
> language "m4" sneaking in
You can add this through Haxe macros also, in a couple of ways.
However, you have raised the issue of not having editor support. Even
if this were added to the language, it wouldn't give you editor
support. So I am confused about your point here.
You could quite easily implement a macro that would make this fly:
Multiline.string(/*
lots and lots
of text
in here
*/);
But the again, that would make "*/" an unsupported sequence. In triple
quote strings, a triple quote is an unsupported sequence. I don't get
why you can't just use normal strings and escape stuff.
I also really don't get why having another file that contains the
string is so inconvenient. In fact chances are that whatever you've
put in there is another language yet again, so you will probably be
better off having the data in a different file so you get syntax
highlighting.
I think you're being rather obsessed about this. If you could calm
down and explain your use case instead of repeating how Python is so
much better as a language (which really isn't going to win people over
to your cause here ;)) and how desperately you need this. Adding
"Please" a gazillion times won't help either. You're talking to a
bunch of people who survived without this feature for years. Show us
eye opening use cases.
Lastly I would stress what others have pointed out already: use macros
if you need a custom interpolation method.
class Interpolate {
macro static public function f(s:String) { ... }
macro static public function s(s:String) { ... }
}
import Interpolate.*;
import Sys.println;
val height = 1.9;
val name = "James";
println(s("Hello, $name"));
println(f("$name%s is $height%2.2f meters tall"));
You could make `@s"Hello, $name"` work with `@:build` macros, but
really I'm not sure shaving off one more character is worth the effort
here.
Anyway. Try showing concrete problems and concrete examples of how
this would be a real improvement. Chances are *really* slim for any
feature to be added, just because "XYZ has it too". Some languages
garner users with code golfing tricks. Haxe is simply not one of them.
Show us that this is about more ;)
Best,
Juraj