Open felixangell opened 8 years ago
These are raw strings (ie. escapes don't parse) right?
@MovingtoMars Yep
What would be the use case for the matching pairs thing?
Typically when you wanted to use somewhere in the string. The problem that arises is however how to handle the situation where we want to have a
as the last character. We also discussed to do a shell style:
a := <<END
stuff goes here
END
How about:
as raw stringssource(
asdf)
for source code, eg:I'm not quite sure i get how that macro is supposed to work, did you accidentally something?
On Thu, 11 Feb 2016 04:12 Liam notifications@github.com wrote:
How about:
as raw strings
- a macro source(
asdf
) for source code, eg:— Reply to this email directly or view it on GitHub https://github.com/ark-lang/ark/issues/692#issuecomment-182681004.
Yeah I don't really understand either
Why is there a need to introduce a new syntax instead of allowing newlines in double-quoted strings?
For example:
shader: string = "
attribute vec3 vertex;
attribute vec3 normal;
…
";
We'd still (preferably) need a way to specify string where we can use symbols like "
and \
without escaping them
A macro like this:
text := source!(`
func main() {
a := "test";
b := `hi`;
}
`);
Which expands to:
text := "\
func main() {\
a := \"test\";\
b := `hi`;\
}\
";
The symbols for denoting a multi-line string are up for debate, though we're okay with
`
, and we also thought about allowing for matching pairs so:And so on are valid.