var filter = [JSTQuickCIFilter quickFilterWithKernel:"""
kernel vec4 ccc(vec4 c){
return c;
}"""];
Would then turn into:
var filter = JSTQuickCIFilter.quickFilterWithKernel_("kernel vec4 ccc(vec4 c){\n return c;\n}");
Good idea? Bad idea? I'm obviously for it, but I'd love to hear other thoughts if you have an opinion on it.
-gus
--
August 'Gus' Mueller
Flying Meat Inc.
http://flyingmeat.com/
Good idea ! Will the editor show it's a multiline string ? (With a different color, or a carriage return symbol ?)
-Patrick
No CR symbol, but it is grey like in a string:
http://gusmueller.com/trash/ea432be6-1ece-441d-8b0c-0c4058e673e9.png
Ha, nice. Although the three """ look a bit heavy. Since you're already transforming @"...." to ObjC strings, why not factor the multilines in that syntax ? (Or use another character prefix)
-Patrick
--
You received this message because you are subscribed to the Google Groups "JSTalk Dev" group.
To post to this group, send email to jstal...@googlegroups.com.
To unsubscribe from this group, send email to jstalk-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jstalk-dev?hl=en.
Well, I chose it because that's what python does, and it's already a common syntax. I figured inventing my own wouldn't make sense. I also thought about going with Perl's, but since there's fewer and fewer perl hackers these days…
> Gus, I like the new syntax, but I like python, so keep that in mind.
> I guess javascript doesn't really have a true multiline string?
Not that I'm aware of, or at least that JavaScriptKit parses.
> Does your new code allow a single quote " inside the multiline like Python
> does?
Currently it doesn't, but that'd be nice to have.
FWIW CoffeeScript also uses triple-quotes for Heredocs:
http://jashkenas.github.com/coffee-script/
The example demonstrates triple-single-quotes (which I prefer -- less visual noise) but it also supports triple-double-quotes.
So you can make at least a small claim of software stare decisis here.