Behavior of Part inside Function

泄露秘密 提交于 2020-01-06 15:22:06

问题


The following gives some strange "Part" warnings

Clear[f];
f = Function[{x}, x[[1]] == x[[2]]]

However if I execute the second line again, it works without warnings, any idea what's going on?


回答1:


Are you sure? I don't see any warnings in version 7.0.1:

In[1]:= Clear[f];
        f=Function[{x},x[[1]]==x[[2]]]

Out[2]= Function[{x},x[[1]]==x[[2]]]


来源:https://stackoverflow.com/questions/4093657/behavior-of-part-inside-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!