| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Start using type names from the type tree rather than the property tree
in most places. Hopefully the only occurrences of
'properties.at(0).second' left are ones where we're managing it. Next we
can stop writing to it.
|
|
|
|
| |
Include type names in the type tree. Though we aren't using them yet.
|
| |
|
| |
|
|
|
|
|
|
|
| |
But I realize that this won't actually streamline
replace_type_ingredients(), which needs that 'if (curr->left)
curr = curr->left' dance for an unrelated reason. So there's no
justification for entering into this big refactoring.
|
| |
|
| |
|
|
|
|
| |
It's only for transient debugging.
|
|
|
|
|
|
| |
to_string(): relatively stable fields only; for trace()
debug_string(): all fields; for debugging
inspect(): for a form that can be parsed back later
|
| |
|
| |
|
|
|
|
|
|
| |
Move code around to put all string-conversion functions in a single
section with a reasonable order, from recipe to instruction to reagent
to reagent members.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Stack of plans for cleaning up replace_type_ingredients() and a couple
of other things, from main problem to subproblems:
include type names in the type_tree rather than in the separate properties vector
make type_tree and string_tree real cons cells, with separate leaf nodes
redo the vocabulary for dumping various objects:
do we really need to_string and debug_string?
can we have a version with *all* information?
can we have to_string not call debug_string?
This commit nibbles at the edges of the final task, switching from
member method syntax to global function like almost everything else. I'm
mostly using methods just for STL in this project.
|
|
|
|
| |
Cleanup.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Attempts at improving the superficial looks of replace_type_ingredients().
These don't change the underlying complexity, but perhaps they help gain
confidence that all cases have been covered.
There's a mini version-history of prior attempts in tmp directories.
But really, the ugliness and duplication here stems from earlier design
choices:
a) Keeping type ordinals and type names in separate trees.
b) Even further back, choosing to duplicate types at properties[0].
|
|
|
|
|
|
|
|
|
| |
New test after yesterday's changes already passing, which helps me gain
some confidence.
There's some redundancy in the shape_shifting_container layer. I'm
probably testing the same things at the level of element_type(), MERGE,
and GET..
|
| |
|
|
|
|
| |
Memory leaks fixed.
|
|
|
|
|
|
|
|
|
|
| |
Still not done, though:
a) There's a few memory leaks to track down, including one in hash from
2668.
b) replace_type_ingredients has gotten *even* uglier. I need to rethink
it.
|
|
|
|
| |
Now I've fixed the type-checker, but it fails while running.
|
|
|
|
|
| |
Getting warmer. The unit tests for element_type now work, and the larger
test too seems to get further.
|
|
|
|
| |
Inline nth_type and nth_type_name.
|
|
|
|
|
| |
Make nth_type non-recursive in advance of hoisting the call into the
caller.
|
|
|
|
|
|
|
|
|
|
| |
Make it explicit that I don't currently intend to further replace type
ingredients inside replacements.
That might well make sense, but I've not thought up any use cases or
tests for it, and it seems excessive at the moment. And when I find bugs
I keep wondering if the repeated replace might be the problem. No
longer.
|
| |
|
|
|
|
|
| |
Also exercise the breaking part in a couple of the unit tests for
replace_type_ingredient. Now we need to fix all three.
|
|
|
|
|
|
| |
Fix the pending test while trying to fix the warning about 'merge'.
Warning still present.
|
|
|
|
|
|
|
|
|
|
|
| |
Eliminated a few holes, gained more clarity on the shape of others.
Maybe I was sleep-deprived, but this was really hard until I wrote a few
unit tests directly on replace_type_ingredient.
Still one flaw remaining: the type-checker isn't smart enough to handle
'merge' for all the new cases. Tests pass since we don't use those
features outside C++ tests yet.
|
| |
|
|
|
|
|
|
|
|
| |
If you don't want a field of a container to be included in its hash, use
the /ignore-for-hash property.
This property only works for containers, not exclusive-containers or
arrays. Mu will warn if you misuse it.
|
|
|
|
| |
I've been gradually Greenspunning reagents. Just go all the way.
|
| |
|
| |
|
|
|
|
|
|
| |
This is smart enough to only look at data and ignores internal
book-keeping like addresses, refcounts and floating-point details.
Though the last is not ideal yet.
|
| |
|
|
|
|
|
|
|
|
|
| |
Since it needs specialized non-overflowing types like unsigned long
long, my plan is to eventually write it in straight machine code using
Mu primitives to make that a slightly nicer process. Hopefully we'll
need to deal with machine types only for a tiny set of crucial
primitives and it won't be too painful to drop down to machine code for
them.
|
|
|
|
|
|
|
|
| |
Thanks Nicolas Léveillé for running up against this bug:
https://news.ycombinator.com/item?id=11094837
(Also noticed and fixed several subsidiary issues. This whole aspect
doesn't seem fully baked yet.)
|
|
|
|
|
| |
Also a bugfix: don't cause future parse errors when these checks are
triggered.
|
|
|
|
|
|
|
|
|
| |
The rule is: every 'local' variable in a recipe must have a fixed size.
Arrays can only be directly used in a recipe if their type includes a
size. But we haven't been warning about this, and attempts to use array
variables could cause silent memory corruption.
(Hopefully this is the last hole in our type system.)
|
|
|
|
|
|
|
| |
The rule is: a container type's size must be fixed. Arrays can violate
this rule if the array length isn't included in the type. But we haven't
been warning about this, and 'new' has been silently turning array
elements to be empty.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Thanks chriscool and achikin for reporting this bug.
|
|\
| |
| | |
move enumerate, tangle dependencies to mu.cc
|
|/ |
|
| |
|