Lazy.jl icon indicating copy to clipboard operation
Lazy.jl copied to clipboard

Warning: using Lazy.take in module Main conflicts with an existing identifier.

Open eccstartup opened this issue 11 years ago • 7 comments

Julia Version 0.3.5
Commit a05f87b* (2015-01-08 22:33 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
julia> using Lazy
Warning: using Lazy.take in module Main conflicts with an existing identifier.
Warning: using Lazy.range in module Main conflicts with an existing identifier.

julia> fibs = @lazy 0:1:(fibs + drop(1, fibs));

julia> take(20, fibs)
WARNING: take is deprecated, use take! instead.
 in depwarn at deprecated.jl:36
 in take at deprecated.jl:8
ERROR: `take!` has no method matching take!(::Int64, ::LazyList)
 in take at deprecated.jl:10

I find other functions/macros work just fine except take-like functions.

By the way, what is the @nobrace like macro?

eccstartup avatar Jan 15 '15 02:01 eccstartup

I'm not seeing this myself. Have you imported any other packages before Lazy.jl?

By the way, what is the @nobrace like macro?

Can you clarify? Happy to help out but I'm not sure I understand your question here.

MikeInnes avatar Jan 18 '15 16:01 MikeInnes

I reply the second question first. I mean a macro that removes brackets. This is discussed here.

eccstartup avatar Jan 19 '15 01:01 eccstartup

For the first one, I didn't import anything.

julia> help(take)
INFO: Loading help data...
take (generic function with 1 method)

julia> methods(take)
# 1 method for generic function "take":
take(...) at deprecated.jl:8

julia> methods(range)
# 7 methods for generic function "range":
range(a::FloatingPoint,len::Integer) at range.jl:155
range(a::Real,len::Integer) at range.jl:73
range{T}(a::T,len::Integer) at range.jl:77
range(a::FloatingPoint,st::FloatingPoint,len::Integer) at range.jl:156
range(a::Real,st::FloatingPoint,len::Integer) at range.jl:157
range(a::FloatingPoint,st::Real,len::Integer) at range.jl:158
range{T,S}(a::T,step::S,len::Integer) at range.jl:88

eccstartup avatar Jan 19 '15 01:01 eccstartup

Regarding the deprecation warnings, I see them in IJulia but not in the REPL. I'm on Julia Version 0.3.7-pre+19 Commit e3fbe7e (2015-03-10 07:59 UTC)

lendle avatar Mar 18 '15 20:03 lendle

@one-more-minute, I believe I'm also seeing this. I'm using Julia 0.4.1. Starting a new REPL session,

julia> using Lazy

julia> fibs = @lazy 0:1:(fibs + drop(1, fibs));

julia> take(20, fibs)
WARNING: both Lazy and Base export "take"; uses of it in module Main must be qualified
ERROR: UndefVarError: take not defined

julia> Lazy.take(20, fibs)
WARNING: both Lazy and Base export "drop"; uses of it in module Main must be qualified
Error showing value of type Lazy.LazyList:
ERROR: UndefVarError: drop not defined
 in anonymous at /Users/admin/.julia/v0.4/Lazy/src/Lazy.jl:84
 in isempty at /Users/admin/.julia/v0.4/Lazy/src/Lazy.jl:80
 in anonymous at /Users/admin/.julia/v0.4/Lazy/src/Lazy.jl:84
 in isempty at /Users/admin/.julia/v0.4/Lazy/src/Lazy.jl:80
 in writemime at /Users/admin/.julia/v0.4/Lazy/src/Lazy.jl:130
 in display at REPL.jl:114
 in display at REPL.jl:117
 [inlined code] from multimedia.jl:151
 in display at multimedia.jl:162
 in print_response at REPL.jl:134
 in print_response at REPL.jl:121
 in anonymous at REPL.jl:624
 in run_interface at /usr/local/Cellar/julia/0.4.1/lib/julia/sys.dylib
 in run_frontend at /usr/local/Cellar/julia/0.4.1/lib/julia/sys.dylib
 in run_repl at /usr/local/Cellar/julia/0.4.1/lib/julia/sys.dylib
 in _start at /usr/local/Cellar/julia/0.4.1/lib/julia/sys.dylib

I installed Lazy with Pkg.add("Lazy"). I have no ~/.juliarc.jl file.

xanderdunn avatar Nov 23 '15 01:11 xanderdunn

@xanderdunn you have to use like Lazy.take(20, fibs) see this thread https://github.com/one-more-minute/Lazy.jl/issues/27

boathit avatar Nov 23 '15 01:11 boathit

@boathit Thanks. You can see above I did actually try Lazy.take(), but I still got an error. I incorrectly assumed it was an error internal to Lazy.take, but actually I just needed to revise my fibs definition to use Lazy.drop as well.

xanderdunn avatar Nov 23 '15 01:11 xanderdunn