[Grace-core] Cross platform graphics library

James Noble kjx at ecs.vuw.ac.nz
Tue Jan 28 15:35:13 PST 2014


> What are our restriction on defining prefix methods?  Do they need to be symbolic or could we make sin prefix?  
> (I suspect we can't because of parsing issues, but maybe?)

prefix methods need to be symbolic;
! foo  explicitly requests "!" on foo

but sin(foo)  implicitly requests sin on self/super/outer/...dialect

> Of course we could also gather math operators together in a module so one has the choice of writing either
> exp.sin
> or
> math.sin(exp)
> I'm not sure I have a strong preference, but I do feel it is nice to have the standard math operations available in the number class.  I.e., if you forced me to choose, I'd probably choose the first.

given the first, a dialect (perhaps even the standard dialect) can define

method sin(n: Number) -> Number {n.sin}  // etc 

we have to talk about primitives (& external objects) but it's easier and conceptually simpler
if we don't have Grace code directly extending primitive objects in general.
which pushes me towards the primitive being on Number rather than an external library.

J


More information about the Grace-core mailing list