No problem – glad we could clear up the confusion. Generic functions take a little getting used to, but once you do, they're extremely powerful and quite intuitive.
On Tue, Apr 8, 2014 at 4:30 PM, Mason McGill <[email protected]>wrote: > > > On Tuesday, April 8, 2014 1:17:06 PM UTC-7, Isaiah wrote: >> >> This is what I was looking for; so if I understand you correctly, you >>> satisfy protocols by extending/monkey-patching Base. This seems >>> reasonable, but what do you do when you want to define your own protocol >>> (e.g. Classifier), and Base doesn't have the functions you'd like to >>> require (e.g. fit, predict)? >>> >> >> As Jameson said (I think): there isn't anything particularly special >> about Base, except that it's installed/available by default. Users will >> need to import your library to use your stuff, so if they want to extend a >> (library) built-in, they will do `import MasonLib: fit, predict` rather >> than the imports from Base. >> >> Oh I see. Sorry if I was thick about this; the languages I'm most used > to (C++, D, Python) solve this problem pretty differently. Julia's > approach is at least as reasonable, IMO. > > Thanks! > -Mason >
