TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Knowing where you are: custom array indices in Julia

98 点作者 jrevels大约 8 年前

5 条评论

goatlover大约 8 年前
I really like how Julia handles arrays.
评论 #14169688 未加载
codezero大约 8 年前
I remember being really intrigued when I ran into Fortran programs that used negative array indices. It's pretty handy in a lot of situations.
评论 #14169670 未加载
rch大约 8 年前
Interesting. It would be nice to surface this approach as a simple spreadsheet app so people could develop an intuitive feel for the concept.
评论 #14169291 未加载
reggieband大约 8 年前
This is very interesting to me but not really revolutionary since I am so used to languages like javascript where array indices don&#x27;t matter the same way they do in C. However, I do see the utility in being able to generate new &quot;views&quot; of an existing array by offsetting all indices by a set amount.<p>First thing that comes to mind is time-series data - like a sliding window based on some concept of &quot;now&quot; where indices can be offset by the current date&#x2F;time. (e.g. timeSeries[0] == now, timeSeries[-1] == one second ago, timeSeries[1] == one second in the future, etc.)<p>I actually find these linear-algebra based languages even more mind-bending than functional based languages.
评论 #14170856 未加载
评论 #14171913 未加载
killin_dan大约 8 年前
This is possible in ruby too, probably in a lot of languages.<p>I&#x27;ve rewritten someobject#[] plenty of times to have cleaner code.
评论 #14171810 未加载
评论 #14171129 未加载