Skip to content

Doesn't seem to support matching variables like Scala, is that intentional? #72

@lotcher

Description

@lotcher

In Scala, we can match as follows

scala> val a = 1
scala> 2 match {
      case a => 1
      case 2 => 2
  }
>>> 2

But does Match only support literal matching? Or is it the bad way I use it

julia> @match 2 begin
           a => 1
           2 => 2
           end
>>>1

What should I do when I want to match a variable on the type? Thank you for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions