Hi Joep,

The way to do this in C is to
> create a structure with all relevant info in it. But since we don't
> have stuctures eiher, we need to add each relevant var as a calling
> parameter.


We don't have struct, but we have array. With getters and setters, you can
consider having something behaving like a struct,


>
> In short: if you only have two bits that relate to the object, make
> them calling parameters.


This is the case here: only two bit parameters (2 pins). But this would give
a weird API. What I want when using this lib is "gimme the distance read by
ranger n°2", and not "using these pins (which appears to identify ranger
n°2), gimme the distance". As a user, I don't even want to know there are
two involved pins, and this can be error prone. I just want to get the
distance, using some kind of abstraction (ranger n°X).

I'll think about this some more...

Cheers,
Seb
-- 
Sébastien Lelong
http://www.sirloon.net
http://sirbot.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to