Re: libseed-list faster sprintf?



I'm not sure I follow you.. gjs doesn't seem to have print() nor Seed.sprintf(), but only log(). Do you mean that if one needs to port scripts from Seed to gjs, then one can just copy the Seed.js code? One could still have a sprintf.js in the tree for that purpose, but have a fast sprintf in C. I find sprintf("foo %d: %f",i,x) much nicer and clearer than "foo "+i+": "+x, plus the additional precision and width features.

BTW, what is the current situation on gjs vs seed?

One thing I don't like with gjs is that I never got it to build so I haven't actually tried it out ;)

But looking at the source, some things I miss in seed are:

- imports.module only looks for 'module.js' for files, not 'module.*'
- imports.directory runs __init__.js (nice way to keep a module in submodules)
- JS 1.8 language features (let, iterators, [a,b,c] = foo(), etc..)

/Jonatan

Alan Knowles wrote:
Keep in mind that there is some concern about keeping gjs and seed reasonably compatible. so writing the printf in Javascript enables both libraries to use it.

Regards
Alan

--- On 17/Jun/2010, Jonatan Liljedahl wrote:
Why not rewrite Seed.sprintf in C, using g_strdup_sprintf()? It would probably be a lot more efficient. If there are no reasons not to, I will be happy to provide a patch.

Also, it would be nice with a prints() (or something) that doesn't add a newline.

/Jonatan
_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list

_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list



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