Giter Club home page Giter Club logo

easyconfig.jl's People

Contributors

joshday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

easyconfig.jl's Issues

First Config creation example not working

The first example provided in the README does not seem to correctly initialize a Config object (at least on Julia 1.7.1 on Windows)

julia> c = Config().one.two.three = 1
1

julia> c
1

display of a config doesn't show keywords that are callable

Sorry about the weird title, I don't really know how to call this behavior as I'm not quite sure what's happening here.

julia> cfg = Config(x=0)
Config with 1 entry:
  :x => 0

julia> cfg.f()=begin
       return cfg.x+1
       end

julia> cfg
Config with 1 entry:
  :x => 0

julia> cfg.x #tab only shows x as a potential keyword

julia> cfg.f()
1

julia> cfg. #tab now shows f and x
f  x

julia> cfg.f #f is not a function
Config()

julia> cfg.f() #but it is still callable
1

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Tab-autocompletion is broken

julia> c.┌ Error: Error in the keymap
│   exception =
│    MethodError: Cannot `convert` an object of type Config to an object of type Symbol
│    Closest candidates are:
│      convert(::Type{T}, ::T) where T at essentials.jl:171
│      Symbol(::Any...) at strings/basic.jl:227
│    Stacktrace:
│     [1] REPL.REPLCompletions.PropertyCompletion(::Config, ::Config) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPLCompletions.jl:30
│     [2] complete_symbol(::String, ::REPL.REPLCompletions.var"#21#25", ::Module) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPLCompletions.jl:150
│     [3] completions(::String, ::Int64, ::Module) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPLCompletions.jl:716
│     [4] completions(::String, ::Int64) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPLCompletions.jl:580
│     [5] complete_line(::REPL.REPLCompletionProvider, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:464
│     [6] complete_line(::REPL.LineEdit.PromptState, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:329
│     [7] complete_line(::REPL.LineEdit.MIState) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:320
│     [8] edit_tab(::REPL.LineEdit.MIState, ::Any, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2032 (repeats 2 times)
│     [9] (::REPL.LineEdit.var"#109#162")(::Any, ::Any, ::Vararg{Any,N} where N) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2073
│     [10] #invokelatest#1 at ./essentials.jl:710 [inlined]
│     [11] invokelatest at ./essentials.jl:709 [inlined]
│     [12] (::REPL.LineEdit.var"#22#23"{REPL.LineEdit.var"#109#162",String})(::Any, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:1364
│     [13] prompt!(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2447
│     [14] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2350
│     [15] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:1143
│     [16] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at ./task.jl:356
└ @ REPL.LineEdit /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2449

Have an AbstractConfig type

Hello again!

I was thinking whether it would be possible or useful to create an AbstractConfig type where most of the AbstractDict interface functions are defined, and make just Config a default concrete subtype.

I don't know if it could have drawbacks, but it would allow to create a different more specific subtype (like PlotlyConfig) to solve the problem here JuliaComputing/PlotlyLight.jl#12 by just defining a custom method for
setproperty!(o::PlotlyConfig, k::Symbol, v) to ensure that 2D arrays are stored as vectors of vectors.

I did not think into details about possible corner cases but I guess having the abstract type might give only potential benefits.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.