如何确定opa中变量的类型? [英] How can one determine the type of a variable in opa?
本文介绍了如何确定opa中变量的类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在学习Opa( opalang.org ).我正在尝试找出如何确定变量的类型.例如功能
I' learning the Opa (opalang.org). I am trying to find out how one can determine the type of a variable. This could be e.g. a function
typeof a // in javascript, this returns the type of a
API文档包含OpaValue.typeof(的描述a)但我找不到如何使用它.
The API-Documentation contains a description of OpaValue.typeof(a) but I can't find out how to use it.
推荐答案
以下是一个简短示例:
int hello = 42
hello_type = OpaValue.typeof(hello)
Log.info("Hello type:", "{hello_type}")
但是我很惊讶您想操纵Opa类型.你的用法是什么?
However i am surprised you want to manipulate Opa types. What is your usage ?
这篇关于如何确定opa中变量的类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文