2

是否有(可能未记录)方法来检测函数是否由分号调用,或者这本质上是不可能的?

例子:

function myfunc()
  if semicolon % <-- how to get this boolean
    disp('semicolon')
  else
    disp('no semicolon')
  end
end

myfunc; % 'semicolon' should be displayed
myfunc % 'no semicolon' should be displayed
4

0 回答 0