In case the accidental matrix happens to be huge you can also get into all sorts of memory shortage related inconveniences.
Den tisdag 24 maj 2016 kl. 07:27:24 UTC+2 skrev Tony Kelman: > > I can see some situations where getting a matrix instead of a vector > because one of the inputs was unexpectedly transposed, then sending the > output to backslash or similar wouldn't trigger an error, just give a > meaningless and unexpected result that would be really difficult to debug. > > > On Sunday, May 22, 2016 at 3:30:11 PM UTC-7, Stefan Karpinski wrote: >> >> The only reason I can think of for map to not just do what broadcast does >> is map's more strict requirements could potentially catch errors. However, >> I suspect that as soon as you used the result, you would rapidly get an >> error anyway, so it's possible that we should merge these. There may be >> some other reason. Probably a good question for julia-dev or a GitHub issue. >> >> On Saturday, May 21, 2016, Tony Kelman <to...@kelman.net> wrote: >> >>> I don't think the behavior of repeating scalars, or expanding outer >>> product dimensions, is really map mathematically, it's something a little >>> different. Dimension mismatches are likely a bug when you really want map. >>> >>> >>> On Saturday, May 21, 2016 at 10:23:36 AM UTC-7, Steven G. Johnson wrote: >>>> >>>> >>>> >>>> On Saturday, May 21, 2016 at 12:36:31 PM UTC-4, Tony Kelman wrote: >>>>> >>>>> I can't think of any aside from the behavior when dimensions don't >>>>> match, which falls under your exceptions... exception. >>>>> >>>>> Maybe map could have a flag to set whether to be picky about matching >>>>> dimensions, or behave like broadcast if not? >>>>> >>>> >>>> Why not just have map behave all the time like broadcast? >>>> >>>