Skip to content

ERROR: UndefVarError: not defined #790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
s-celles opened this issue Aug 13, 2018 · 8 comments · Fixed by #791
Closed

ERROR: UndefVarError: not defined #790

s-celles opened this issue Aug 13, 2018 · 8 comments · Fixed by #791
Milestone

Comments

@s-celles
Copy link

Hello,

I'm currently working on JuliaCollections/DataStructures.jl#360 and trying to add @repl / @setup macros for examples in default_dict.md

the following minimal file

# DefaultDict and DefaultOrderedDict

```@setup DataStructures
using DataStructures
```

```@repl DataStructures
dd = DefaultDict{AbstractString, Vector{Int}}(Vector{Int})

push!(dd["A"], 1)

push!(dd["B"], 2)

dd
```

is badly rendered with Julia 0.7

julia> dd = DefaultDict{AbstractString, Vector{Int}}(Vector{Int})
DefaultDict{AbstractString,Array{Int64,1},DataType} with 0 entries

julia> p
┌ Warning: Deprecated syntax `underscores as an rvalue`.
└ @ none:0
ERROR: UndefVarError:  not defined

julia> ush!(dd["A"], 1)
ERROR: UndefVarError: ush! not defined

julia> p
┌ Warning: Deprecated syntax `underscores as an rvalue`.
└ @ none:0
ERROR: UndefVarError:  not defined

julia> ush!(dd["B"], 2)
ERROR: UndefVarError: ush! not defined

julia> d
┌ Warning: Deprecated syntax `underscores as an rvalue`.
└ @ none:0
ERROR: UndefVarError:  not defined

julia> d
ERROR: UndefVarError: d not defined

Any idea?

Thanks

@fredrikekre
Copy link
Member

Looks like #749, can you try #749 (comment) and report back on the other issue?

@s-celles
Copy link
Author

After saving my Markdown file with Visual Studio Code and LF (instead of CRLF) as EOL it seems to be fixed!
I will use this workaround.

@fredrikekre
Copy link
Member

After saving my Markdown file with Visual Studio Code and LF (instead of CRLF) as EOL it seems to be fixed!

Okay thanks. But this should be handled by Documenter automatically, but I guess we miss that at some place then.

@s-celles
Copy link
Author

This workaround can't in fact be used because when trying to add file using git I see

warning: LF will be replaced by CRLF in docs/src/default_dict.md.
The file will have its original line endings in your working directory.

So you are right! Documenter need to handle that

@s-celles
Copy link
Author

Please reopen issue

@s-celles
Copy link
Author

With Mac OS X, the previous file with LF as EOL (according Visual Studio Code) rendered as

julia> dd = DefaultDict{AbstractString, Vector{Int}}(Vector{Int})
DefaultDict{AbstractString,Array{Int64,1},DataType} with 0 entries

┌ Warning: Deprecated syntax `underscores as an rvalue`.
└ @ none:0

julia> push!(dd["A"], 1)
1-element Array{Int64,1}:
 1

┌ Warning: Deprecated syntax `underscores as an rvalue`.
└ @ none:0

julia> push!(dd["B"], 2)
1-element Array{Int64,1}:
 2

┌ Warning: Deprecated syntax `underscores as an rvalue`.
└ @ none:0

julia> dd
DefaultDict{AbstractString,Array{Int64,1},DataType} with 2 entries:
  "B" => [2]
  "A" => [1]

this is again different!

@fredrikekre
Copy link
Member

fredrikekre commented Aug 14, 2018

The original issue is fixed, the parsing now works as you can see. The warning is something else, probably from your own code since I can not find any use of _ in Documenter. You can try starting julia with julia --depwarn=error to get a stacktrace.

@s-celles
Copy link
Author

Not sure if we should consider this as an issue but

$ julia --depwarn=error docs/make.jl

raises error but not

$ julia docs/make.jl --depwarn=error

Anyway I have to first fix DataStructures code because

WARNING: importing deprecated binding Base.Associative into DataStructures.
Base.Associative is deprecated, use AbstractDict instead.
ERROR: LoadError: deprecated binding: Base.Associative
Stacktrace:
 [1] top-level scope at none:0
in expression starting at /Users/scls/.julia/dev/DataStructures/docs/make.jl:5

but that's an other story

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants