Skip to content

Magpie should allow defining of sentinel values in the library #43

@mrfoogles

Description

@mrfoogles

I read this blog post, which says that since Iterators and Channel.receive both behave in special ways with done, you are unable to put done in arrays. I agree that this is not a very common use case, but I think there's a better way to do it.

What you could define sentinel values in magpie? channel_done and iterator_done would both be sentinel values defined in the standard library. I think this fits magpie guide: the heart of magpie's parts about giving the user power and defining things in the library better as well.

I don't think this would be too hard to implement; just extend the code handling 'nothing' to any sentinel value. This might be possible regardless using fieldless classes, but it would be nice to have it work the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions