Quick actions

cmd+k|ctrl+k

Navigation

Languages

Untitled

Snippet info

Language

Nim

Visibility

unlisted

Author

legacy-anonymous

Created

2017-04-05T22:27:12Z

Updated

2017-04-05T22:27:12Z


type # ports
  PortKind = enum
    Bool, Int, Float, String
  PortType = concept c
    (c is bool or
     c is int or
     c is float or
     c is string)
  NumericPort = concept c
    c is PortType
    c is int or c is float

type # parameters
  Parameter[T: PortType] = object
    name: string
    value: T
    when T is NumericPort:
      minVal, maxVal: T


var p = Parameter[float]("freq", 440.0, 0.0, 20000.0)

INFO