f - was just what I typed into the interpreter before it threw a StackOverflow error - in fact typing anything did that it just happened to be f. Does the following work on your version after loading the code?
x = rand(100); y = map(Nullable, x); v4(x) = x^4 map(v4, x); map(v4, y); If it does I should probably shift to 0.4. On Monday, October 5, 2015 at 2:41:38 PM UTC+1, Simon Danisch wrote: > > I can't reproduce it on 0.4. > But I have an improvements: > https://gist.github.com/SimonDanisch/92e4500a0198c81912f5#file-jl > Map works perfectly fine with tuples ;) > > >When I type in anything else into the interpreter in this case f > > what f? > > > Am Montag, 5. Oktober 2015 15:27:45 UTC+2 schrieb [email protected]: >> >> I am trying to "lift" base functions to allow Nullable types to be used >> natively I am getting a stack-overflow error with the following code: >> >> # Test with just a few functions >> import Base: get, +, -, /, *, ^ >> >> # Function symbols to be lifted >> funs = [:+, :-, :/, :*, :^] >> >> # Generic get function >> # Assume appropriate get functions are written for each type >> function get{T}(x::T) >> x >> end >> >> S = Union{Symbol, Expr} >> >> # Lifter function >> function lift(fun_name::S, new_type::S) >> quote >> function $fun_name{T}(x...;t::T=x) >> y = Array(Any, length(x)) >> for i in 1:length(x) >> y[i] = get(x[i]) >> end >> ret = $fun_name(y...) >> return $new_type(ret) >> end >> end >> end >> >> # Then lift the functions >> for i in funs >> eval(lift(i, :Nullable)) >> end >> >> When I type in anything else into the interpreter in this case f, I get >> the error message: >> >> WARNING: Caught an exception in the keymap: >> ERROR: StackOverflowError: >> ERROR: UndefVarError: f not defined >> >> Another odd thing about this error is that it doesn't always happen right >> away and sometimes doesn't happen at all which is odd. I have also tried >> loading the code by include(scriptfile.jl) but the same thing happens >> >> My Environment: Version Info: 0.5.0-dev+433 (2015-09-29 15:39 UTC), >> Ubuntu 14.04 x86_64-linux-gnu >> >> DP >> >> >>
