[julia-users] Re: Indexing Array with empty vector in v.0.4.

2015-07-22 Thread Felipe Jiménez
That would also be fine with me, if there is a WARNING: Indexing with 
Integers would be faster or something like that.

And once we are here, it would also be convenient if indexing with an empty 
Array (whatever its element type) would always return empty, and that 
minimum([]) did not error, but return empty too, etc. I guess many 
functions could safely return Empty when applied on Empty. But these are 
petty niceties that can easily be circumvented with if isempty... else... 
branches.


[julia-users] Re: Indexing Array with empty vector in v.0.4.

2015-07-21 Thread Christoph Ortner


 But I think Julia started off as very intuitive and educational and I hope 
 it will continue on this road =)


+ 1e1e1e...



[julia-users] Re: Indexing Array with empty vector in v.0.4.

2015-07-20 Thread Simon Danisch
This is actually one of the biggest missing features in most programming 
languages. 
Giving good interactive feedback and educating people instead of 
disallowing things just because these noobs can't deal with it 
anywaysaand because its actually pretty hard to give good feedback :D
But I think Julia started off as very intuitive and educational and I hope 
it will continue on this road =)

Am Samstag, 18. Juli 2015 12:00:16 UTC+2 schrieb Felipe Jiménez:

 Say A is an Array, like A = [1 2 3 4], and I index it with an empty vector.

 In Julia v.0.3, A[[]] is empty. I find this convenient when programming.

 In Julia v.0.4, A[[]] throws an error.

 Is this intended? It sometimes forces me to code if isempty()... else...

 My version is 0.4.0-dev+5841 (2015-07-07 14:58 UTC), Commit f428392* (10 
 days old master), x86_64-w64-mingw32.

 Thank you.



[julia-users] Re: Indexing Array with empty vector in v.0.4.

2015-07-19 Thread Felipe Jiménez
Thanks, Yichao Yu, Int[] does solve it for me.
Hope you found how to make your irrelevant denormals not slow down your 
code. For what I do, I would also agree to flush them all to 0 if that 
speeds up my code significantly.