One feature we could learn from Matlab?

I really like how Matlab can automatically load some types of files into its memory. For example, if I have a MAT file, I can just drag and drop it into Matlab, that’s all it takes to load the file into Matlab. By typing whos, I can see all of the stored variables.

I wonder if Julia can do the same thing?

Actually it seems this one is better:

5 Likes

The varinfo function used to be called whos but at some point we realized that was a terrible name and changed it.

9 Likes

And I’d imagine supporting drag-and-drop will be hard / difficult because Julia is not an IDE. However, it might be able to support it for some terminals / front ends perhaps (if we would want to).

2 Likes

The drag-and-drop part indeed requires some kind of GUI that can detect the drag-and-drop event. The way it’s handled in Matlab, or at least was ten years ago, is that the drag-and-drop event is converted into a global scope function call to uiopen, with the filename as argument. Depending on the file type this is in turn dispatched to a number of different functions and you can also intercept the uiopen call with your own function if you engineer the function search path appropriately.

2 Likes