Comments (7)
BTW, not "if" since that returns the value of whatever branch executes.
from julia.
...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.
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.
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.
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.
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.
Closed by 20e911d.
from julia.
Related Issues (20)
- QA with a large csv dataset HOT 2
- `cfg_simplify!` error
- `@nospecialize` on argument destructuring
- Using `include_dependency` with a non-existent file triggers precompilation at every startup HOT 2
- Can we skip writing the key into a `Dict` if we know it's already present? HOT 3
- `Undefined symbols: ___truncsfbf2` when building on macOS HOT 9
- 50x regression in copying large custom arrays. HOT 1
- ConsoleLogger not active in the REPL HOT 2
- `Base.two_mul` is constant folding incorrectly on 1.10 (but not 1.9 or 1.11) HOT 17
- "Poison" similar arrays HOT 7
- Missing package install prompt not showing before Pkg is loaded
- Prompt to add an uninstalled package on `using` only occurs if Pkg is loaded HOT 1
- Error in displaying `SubArray`s with `AbstractVector{<:CartesianIndex}` indices
- `UndefRefError` due to line completion in REPL HOT 5
- Inappropriate number of digits displayed by `show(::Complex{BigFloat}` HOT 8
- Segmentation fault in codegen upon storing ghost value to PhiC node with unboxed type HOT 1
- Explicit task pin/unpin interface HOT 3
- Deprecate `Base.@async` HOT 2
- Teach jl_create_native to emit ccallable aliases HOT 4
- Type signature abbreviation in method error sometimes hides the information you need to know why it doesn't match HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.