[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Re: string formatting notation



> On 23 Dec 2017, at 14:54, Scott Wilson <s.d.wilson@xxxxxxxxxx> wrote:
> 
> 
> 
>> On 23 Dec 2017, at 14:50, <jamshark70@xxxxxx> <jamshark70@xxxxxx> wrote:
>> 
>> Scott Wilson-3 wrote
>>> If you want expressions and don’t care about security then the whole thing
>>> can be implemented using a search and interpret.
>> 
>> `interpret` doesn't have access to the local scope. It could work only for
>> environment variables.
> 
> Yes that just occurred, though you could make a class which would make a function at instantiation time.

Hmm. You’d have to do it back end for that to work I think.

But honestly I don’t see the point of that. The looking up vars for you thing is sort of nice. But this:

	f”Result plus one is {foo + 1}”

is to my mind no better than this

	”Result plus one is %”.format(foo + 1);

It’s probably worse, really. Less readable (for some values of readable ;-) and makes you learn two things instead of one. If we add interploation I’d suggest no expressions. It would make it a lot simpler as well.

S.
_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/