0
Julia具體具有函數定義嗎?如果是,BNF是什麼?Julia中的函數定義
例如,它有一個函數聲明和函數調用了BNF
•Function Declaration
function name (arguments :: type)
#expressions
End
<function> → (function <identifier> (<arguments>) <expressionList> end) |
<identifier>(<arguments>) <expressionList> end
<arguments> → <identifier> :: <type> | (<identifier> :: <type>),arguments>|e
•Function Call
x = sum (12 , y :: Int32)
<funcall> → <identifier> = <identifier> (<parameterList>)
<parameterList> → <parameter> :: <type>, < parameterList> | <parameter> ::<type> | <parameter>, <parameterList>
<parameter> → <identifier> | <element> | e
Julia語法不是上下文無關的。請參閱:https://groups.google.com/d/msg/julia-users/LwewtNffleo/f-AqxMulbFwJ –