ferrum icon indicating copy to clipboard operation
ferrum copied to clipboard

Provide documentation in readme for standard traits

Open koraa opened this issue 6 years ago • 2 comments

koraa avatar Jul 08 '19 18:07 koraa

@koraa Can I know more about this issue?

Sweta271097 avatar Oct 12 '19 20:10 Sweta271097

Sure, feel free to take it! Thanks for taking interest in this project!

Ferrum provides a few standard traits in the stdtraits.js file; most notably eq for content based comparisons. Most languages provide such a trait as an overloadable part of their standard lib (.equals in Java, eq in python, operator ==() in C++…similar traits exist in rust & haskell). Js provides === (value based comparison) and libraries like lodash provide content based comparison for a limited number of types (meaning it may not work for custom types).

The eq trait in ferrum is extensible for custom traits.

A short introduction to the standard traits provided by this lib and an explanation why a trait/overloadable approach is superior should be added to the readme.

koraa avatar Oct 13 '19 12:10 koraa