在Cadence SKILL(专有EDA语言,基于LISP & SCHEME)中,可以在过程中定义参数类型。
如果给出错误类型的参数,它将会出错。请参阅下面的shell报告:Ruby:类型跳棋参数,类似于Cadence SKILL
procedure(foo(ko "t") printf("Hey %s\n" ko))
>foo
>foo("1")
>Hey 1
>t
foo(1)
>*Error* foo: argument #1 should be a string (type template = "t") - 1
有没有像Ruby那样漂亮的东西?也就是说,在方法接口定义中,不是主体,类型检查完成了吗?
谢谢。
否。Ruby没有内置类型注释。 –