Giter VIP home page Giter VIP logo

Comments (7)

JeffBezanson avatar JeffBezanson commented on April 28, 2024

BTW, not "if" since that returns the value of whatever branch executes.

from julia.

JeffBezanson avatar JeffBezanson commented on April 28, 2024

...unless of course no branch executes.
I see you assigned yourself so I'll just make some helpful comments. In the intermediate representation I use (null) (null_sym in C) for "no value" so the interpreter and compiler should return Nothing for this instead. Nothing should be defined in boot.j and handled in init.c and dump.c the same as the other stuff in jl_get_builtin_hooks(). Then replace jl_null with jl_nothing where appropriate in the C code --- this is tricky, as some cases actually need to be 0-tuples. Replacing the cases in j/ should be fairly easy.

from julia.

StefanKarpinski avatar StefanKarpinski commented on April 28, 2024

Excellent. Thanks for the tips. Will attempt this.

On Jun 2, 2011, at 6:32 PM, [email protected] wrote:

...unless of course no branch executes.
I see you assigned yourself so I'll just make some helpful comments. In the intermediate representation I use (null) (null_sym in C) for "no value" so the interpreter and compiler should return Nothing for this instead. Nothing should be defined in boot.j and handled in init.c and dump.c the same as the other stuff in jl_get_builtin_hooks(). Then replace jl_null with jl_nothing where appropriate in the C code --- this is tricky, as some cases actually need to be 0-tuples. Replacing the cases in j/ should be fairly easy.

Reply to this email directly or view it on GitHub:
#28 (comment)

from julia.

StefanKarpinski avatar StefanKarpinski commented on April 28, 2024

I'm getting errors like this:

type error: new_struct_type: expected Function, got NothingType /Users/stefan/projects/julia/j/sparse.j:2 /Users/stefan/projects/julia/j/sysimg.j:58

which I think comes from this line:

#3  0x00000001000290c9 in jl_f_new_struct_type (env=0x0, args=0x7fff5fbfc478, nargs=4) at builtins.c:993
992     if (args[3] != (jl_value_t*)jl_null)
993         JL_TYPECHK(new_struct_type, function, args[3]);
(gdb) p args[3] == jl_null   
$6 = 0
(gdb) p args[3] == jl_nothing
$7 = 1

So jl_f_new_struct_type is getting jl_nothing when it should be getting jl_null. I think this is a matter of the codegen/interpreter turning null_sym into jl_nothing where it should be yielding jl_null but I'm not sure what to do about it. Presumably the parser should distinguish between () and Nothing.

from julia.

JeffBezanson avatar JeffBezanson commented on April 28, 2024

In this case the frontend is passing (null) to new_struct_type just as a flag to indicate nothing is there. Change jl_f_new_struct_type to expect jl_nothing instead.

from julia.

JeffBezanson avatar JeffBezanson commented on April 28, 2024

If you want you can send me a list of occurrences of jl_null you're not sure about and I can help.

from julia.

StefanKarpinski avatar StefanKarpinski commented on April 28, 2024

Closed by 20e911d.

from julia.

Related Issues (20)

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.