Skip to content
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

load not displaying errors for missing "end" #155

Closed
zingales opened this issue Jul 25, 2011 · 0 comments
Closed

load not displaying errors for missing "end" #155

zingales opened this issue Jul 25, 2011 · 0 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@zingales
Copy link
Contributor

is it possible to make load functions display error if there are not the correct amount of ends?

because what happens if there is not the correct amount of ends weird stuff happens, that a lot of times looks like load function is not loading your new methods.

##example function
function gen_cartesian_map(cache, genbodies, ranges, exargnames, exargs...)
    N = length(ranges)
    if !has(cache,N)
        dimargnames = { gensym() | i=1:N }
        ivars = { gensym() | i=1:N }
        bodies = genbodies(ivars)

        ## creating a 2d array, to pass as bodies
        if isa(bodies,Array)
            if (length(size(bodies))==2)
                println("2d array noticed")
                body = bodies[1]
                bodies = bodies[2:end,:]
            elseif (length(size(bodies))==1)
                println("1d array noticed")
                body = bodies[1]
                bodies_tmp = cell(N,2)
                for i = 1:N
                    bodies_tmp[i] = bodies[i]
                    bodies_tmp[i+N] = nothing
                end
                bodies = bodies_tmp
            ##THERE SHOULD BE AN END HERE
        else
            println("no array noticed")
            body = bodies
            bodies = cell(N,2)
            { bodies[i] = nothing | i = 1:N}
        end
        fexpr =
        quote
            let _dummy_=nothing
                local _F_
                function _F_($(dimargnames...), $(exargnames...))
                    $make_loop_nest(ivars, dimargnames, body, bodies)
                end
                _F_
            end
        end
        f = eval(fexpr)
        cache[N] = f
    else
        f = cache[N]
    end
    return f(ranges..., exargs...)
end

exmaple behavior

julia> load("tensor.j")

julia> find(y)
     no method size(Expr,)
     in method_missing, boot.j:274
     in gen_cartesian_map, /home/g3/julia/j/tensor.j:321
     in find, /home/g3/julia/j/tensor.j:922
     in run_repl, /home/g3/julia/j/client.j:21
     in _start, /home/g3/julia/j/client.j:157

##after this line of code i fix the error that find is running into but do not fix the missing end##
julia> load("tensor.j")

julia> find(y)
     no method size(Expr,)
     in method_missing, boot.j:274
     in gen_cartesian_map, /home/g3/julia/j/tensor.j:321
     in find, /home/g3/julia/j/tensor.j:922
     in run_repl, /home/g3/julia/j/client.j:21 
     in _start, /home/g3/julia/j/client.j:157

However, only i try to make again do i get

BackTrace(LoadError(ASCIIString(Array()),30,LoadError(ASCIIString(Array()),7,ErrorException(ASCIIString(Array())))),Array())

and i think thats only because tensor.j is loaded into the sysimg

@ghost ghost assigned JeffBezanson Jul 25, 2011
StefanKarpinski pushed a commit that referenced this issue Feb 8, 2018
Compat for Filesystem clean up
KristofferC pushed a commit to KristofferC/julia that referenced this issue Feb 25, 2018
allow packages to load dependencies at top level when building or testing
KristofferC pushed a commit that referenced this issue Aug 25, 2023
Stdlib: Tar
URL: https://github.com/JuliaIO/Tar.jl.git
Stdlib branch: master
Julia branch: master
Old commit: ff55460
New commit: 81888a3
Julia version: 1.11.0-DEV
Tar version: 1.10.0 (Does not match)
Bump invoked by: @DilumAluthge
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaIO/Tar.jl@ff55460...81888a3

```
$ git log --oneline ff55460..81888a3
81888a3 Correct some typos (#159)
a82ddde Fix some issues found by JET (#162)
6c51ea7 Give hint about possible insufficient storage on error message (#161)
84e6571 minimize impact of invalidations due to uninferred `ctx` (#158)
b0b8ec7 Merge pull request #157 from JuliaIO/dependabot/github_actions/actions/checkout-3
24bb56d Merge pull request #156 from JuliaIO/dependabot/github_actions/codecov/codecov-action-3
9f7d944 Merge pull request #155 from JuliaIO/dependabot/github_actions/actions/cache-3
d14feb4 Bump actions/checkout from 2 to 3
f149f85 Bump codecov/codecov-action from 1 to 3
ea228f2 Bump actions/cache from 1 to 3
4b54b0c Merge pull request #153 from ranocha/hr/dependabot
c70adcb enable dependabot for GitHub actions
cf089ab fix some sources of invalidations (#152)
```

Co-authored-by: Dilum Aluthge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants