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

Prototypal #21

Open
alexispurslane opened this issue Dec 14, 2014 · 4 comments
Open

Prototypal #21

alexispurslane opened this issue Dec 14, 2014 · 4 comments

Comments

@alexispurslane
Copy link

I think it would be nice if Streem used prototypal inheritance and object literals, (as in JavaScript). This makes for a very light-weight, expressive, powerful, and most of all, quick OOP-type programming experience.

@alfa256
Copy link

alfa256 commented Dec 14, 2014

When dealing with streams OOP obscures reasoning ( what type is this? does it have this function? does it have this property? Etc) , structs or dictionaries are better suited to improve code reuse, since you can simply check for fields and the values are either other structs or a built in variable type. Although dictionary/struct literals are ok for me, just no functions embedded inside data.

@alexispurslane
Copy link
Author

Exactly. Prototypal objects are dictionaries/hashes that can optionally get properties from another object on it's prototype.

@nickserv
Copy link
Contributor

👍 I agree, I like how lightweight prototypical inheritance is.

However, I'm not sure how this would work if Streem were to use static typing or some other sort of type checking. I guess something like Go's type checking could be used, where objects can be duck typed, but the types are still checked for the appropriate methods and fields at compile time.

@alexispurslane
Copy link
Author

Yup. See #12, where I suggested soft-typing very similar to yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants