Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 002-covers-vs-classes.md #7

Merged
merged 1 commit into from Mar 31, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions 002-covers-vs-classes.md
@@ -1,4 +1,3 @@

When to use covers and classes
==============================

Expand Down Expand Up @@ -48,16 +47,16 @@ is changed to -1

### Covers ###

Covers are trickier. There are two types of covers: primitive covers, and compound covers
Covers are trickier. There are two types of covers: primitive covers and compound covers

Primitive covers allow to add methods to an existing type. For implementations
of ooc on top of C, it means you can do stuff like:
Primitive covers allow to us to add methods to an existing underlying type. For implementations
of ooc on top of C this means you can do stuff like:

~~~
Int: cover from int
~~~

And it's actually the way all C types are used from ooc.
This is actually the way all C types are used within ooc.

As a consequence, covers are by-value. Which means that

Expand Down