Skip to content

Function caching issue with broadcastΒ #9869

@pfitzseb

Description

@pfitzseb

An issue with broadcasting came up in the Juno forums and I couldn't find anything relevant in the mailing list or here.

From a brief look at the code broadcast caches functions - this seems to lead to redefined methods being ignored when using broadcast again.

This means fun stuff like

julia> f(x) = x^2
f (generic function with 1 method)

julia> broadcast(f, [1 2 3])
1x3 Array{Int64,2}:
 1  4  9

julia> f(x) = x^3
f (generic function with 1 method)

julia> broadcast(f, [1 2 3])
1x3 Array{Int64,2}:
 1  4  9

I do hope that this is not the intended behaviour - should it be, this certainly needs to be added to the docs.

versioninfo:

Julia Version 0.3.5
Commit a05f87b* (2015-01-08 22:33 UTC)
Platform Info:
  System: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Xeon(R) CPU           W3530  @ 2.80GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

(Doesn't look like the relevant code has changed on master though, so it should 'work' there too)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions