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

Match Statement #81

Open
DavePearce opened this Issue Jun 28, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@DavePearce
Member

DavePearce commented Jun 28, 2012

Would very much like to enable switching on types. Unclear to me whether we need an explicit operator to get the type of a variable, and/or whether we should just allow them inline with other values.

switch x:
    case int:
        return "INTEGER"
    case [int]:
        return "LIST OF INTEGER"
@DavePearce

This comment has been minimized.

Show comment
Hide comment
@DavePearce

DavePearce Aug 22, 2013

Member

One alternative here would be to use a match statement instead. The key challenge with switch is whether or not we can distinguish types and expressions.

NOTE: Rust supports the match statement for pattern matching like this.

Member

DavePearce commented Aug 22, 2013

One alternative here would be to use a match statement instead. The key challenge with switch is whether or not we can distinguish types and expressions.

NOTE: Rust supports the match statement for pattern matching like this.

@DavePearce DavePearce removed WYC labels Oct 19, 2016

@DavePearce DavePearce changed the title from WYC / WYIL: Type Switches to Match Statement Jun 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment