Skip to content

Make API less abstract and confusing #10

Open
@sdroege

Description

@sdroege

What I would suggest is the following

  • Foo becomes Animal
    • Implements Nameable
    • increment() vfunc becomes pet() and returns a Sound (former RString). E.g. cats would "purr"
    • incremented signal becomes made_sound(), see above. This can of course also happen independently of calling
    • name property stays and maps to the Nameable interface
    • Add a new lift() vfunc that either succeeds or returns the (to be written) GError: "too heavy", "too slippery" (e.g. a fish), "hissed", etc
    • Add a new environment read-only property of type Environment (the flags type): "house", "garden", "aquarium", whatever
  • Bar becomes Cat
    • number property would become collar-color of type Color (the enum)
  • Nameable can stay the same, Animals and other things are usually nameable
  • RString becomes Sound (or a better name)
    • Also we'd add accessors for the non-NUL-terminated string plus length without copying
  • SharedRString becomes Name (and is used as part of Nameable). Names are usually used often and immutable
    • Also we'd add accessors for the non-NUL-terminated string plus length without copying

CC @elmarco what do you think? Any suggestions for improvements or changes? :)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions