documenting /src/foundation/gclib_inflector.js

0 views
Skip to first unread message

agent marmorkuchen

unread,
Mar 9, 2009, 2:45:05 PM3/9/09
to groundcrew-vie...@googlegroups.com
hoi...

looking at /src/foundation/gclib_inflector.js:

- tt: what does this line mean: var self = this; why not use this?

- ellipticise: my dictionary does not know this word and since usually
american spelling is used, would it make sense to rename it to
ellipticize? or does that look awkward to you (it does to me,
actually)?

- singularize: needs a bit of work at some stage. boxes -> boxe?

- sanetize: rename it correctly to sanitize? might need some work later
on, as it only replaces blanks by underscores.

- indef_article: needs a bit of work, too. or do you write 'an user'?

- number_plural: add the line if (!plural) plural = singular + "s";?
- number_plural: perhaps rename it to pluralize_number_word?


bye,
marmorkuchen
--
_ ascii ribbon campaign .oOo. GCSd-s:+aC++ULB+++W++M+PS+++Y+
( )
X Der naechste Satz ist eine Luege. Der vorhergehende Satz ist
/ \ wahr.

Joe Edelman

unread,
Mar 9, 2009, 3:43:51 PM3/9/09
to groundcrew-vie...@googlegroups.com
tt:

Unfortunately, in javascript, "this" is not adequately lexically scoped.
In particular, the "this" inside an anonymous function is not often the
containing this. So workarounds like this are necessary. The var self
thing is a common convention.

I really don't care about english vs. american spelling. I don't think
we need a convention.

Spelling ERRORS however I do care about. In my tree, sanetize has been
fixed to sanitize. It doesn't appear to be used anywhere right now
though. I think I wrote it around the original implementation of the
idea catalog, and then changed the implementation a bit so it wasn't
required.

I've also updated and renamed number_plural.

--Joe

--
J.E. -- http://nxhx.org -- 413.250.8007
Reply all
Reply to author
Forward
0 new messages