bevry / cson

CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.
Other
1.34k stars 56 forks source link

parse vs parseSync and stringify vs stringifySync #9

Closed meltingice closed 12 years ago

meltingice commented 12 years ago

The naming around parse/parseSync and stringify/stringifySync is misleading because they really aren't async at all since it always uses the sync version and then calls the provided callback function.

If anything, I'd imagine the functions should be merged in such a way that you can provide a callback to be fired upon error.

balupton commented 12 years ago

Hey mate,

Yeah it is a bit weird... It is so we can follow node.js naming conventions, and to perhaps one day have proper async parsing/stringifying, which would then be a graceful upgrade for everyone.

meltingice commented 12 years ago

Just a continuing thought... until true async parsing arrives, however you intend to implement that, perhaps the async versions should be wrapped in a setTimeout() internally? This would make the function call actually async and would make the upgrade even more graceful.

balupton commented 12 years ago

Ooooo, that's a nice idea. +1

Are you happy to do a pull request?

meltingice commented 12 years ago

Done and done.

balupton commented 12 years ago

Released as v1.0.1.