Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ed84c0c
notes
jcupitt Oct 25, 2025
3a6ffa1
more hacking
jcupitt Nov 3, 2025
c5ac66c
more hacking
jcupitt Nov 4, 2025
1ebe3fb
more argh
jcupitt Nov 5, 2025
421d08b
hackikng away
jcupitt Nov 5, 2025
e3ab59f
stuff
jcupitt Nov 7, 2025
787e5e7
start rewriting all pattern matching
jcupitt Nov 10, 2025
bdc3f98
pattern match rewrite almost done
jcupitt Nov 10, 2025
27dfab1
pattern match rewrite passes the first test
jcupitt Nov 11, 2025
0f0ff42
codegen for multiple rhs passes first test
jcupitt Nov 11, 2025
4e5149a
note another bug
jcupitt Nov 11, 2025
999f3b2
note codegen after parse unit
jcupitt Nov 12, 2025
daf3670
getting closer
jcupitt Nov 12, 2025
bf30913
Merge branch 'multiple-rhs' of github.com:jcupitt/nip4 into multiple-rhs
jcupitt Nov 12, 2025
56fa8cc
next multidef example works
jcupitt Nov 13, 2025
28034ac
make later defs local to main def
jcupitt Nov 13, 2025
ccf264a
multiple defs test case three works
jcupitt Nov 13, 2025
a807657
add some tests
jcupitt Nov 13, 2025
4fce632
detect redefinition across parse units
jcupitt Nov 14, 2025
164f847
case three works
jcupitt Nov 17, 2025
69dadfb
fix up filemodel merge
jcupitt Nov 17, 2025
4713a08
fix access to nested structs
jcupitt Nov 18, 2025
eac8ee1
more debugging
jcupitt Nov 19, 2025
05371db
omg fixed pattern defs
jcupitt Nov 19, 2025
0fbe089
more fixes
jcupitt Nov 20, 2025
ca80c9f
fix local multiple defs
jcupitt Nov 20, 2025
77bb4a9
tiny
jcupitt Nov 21, 2025
f80404b
fix Vector ++ Image
jcupitt Nov 21, 2025
1541864
fix Image op Vector
jcupitt Nov 21, 2025
19a9561
add more tests for multiple RHS
jcupitt Nov 21, 2025
b065ec3
ready for 9.0.14 release
jcupitt Oct 25, 2025
dcb6ebf
fix date
jcupitt Nov 21, 2025
7d2b978
Merge branch 'main' into multiple-rhs
jcupitt Nov 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## master

- pattern matching rewrite
- add multiple defs and parameter pattern match to compiler
- add filemodel::new_from_file, rework filemodel_open
- reloading a toolkit now deletes all defs, then does load ... adding a new
def to a func across a parse unit is now an error

## 9.0.14 2025/10/25

- fix load cancel
Expand Down
64 changes: 40 additions & 24 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,38 +1,54 @@
- should allow vips_image ++ Image
- nicholas's bug report

- remove remove prefs workspace stuff?
- lcomps leave stray unreffed symbols in "list unresolved"

things like max heap size should be settable ... maybe pres are useful?
Image_transform_item.Resize_item.Size_within_item.action.within ($SAVEDIR/start/Image.def:509) refers to undefined symbol h
Image_transform_item.Resize_item.Size_within_item.action.within ($SAVEDIR/start/Image.def:509) refers to undefined symbol w

- add multiple definitions, finish function argument destructuring
- rework pattern matching in lcomps

sym has a field for "next definition", initially NULL
- what does the programming window do for multiple defs?

` add_defining looks for an existing sym with this name, if it finds
one, add a new sym called "{name}-$$4" or whatever
probably need to follow next_def and concatenate them all

chase to the end of "next definition" on the existing sym, append our
new sym
- dir should hide $$vars

during compile, generate code like
- programming window is showing generated syms, like $$pattern_lhs0?

fred a b c
= destructured_fred, args_match
= fred-$$1 a b c
{
destructured_fred = rhs of fred
args_match = a_matches && b_matches && c_matches
}
- ban patterns in class parameters

or could we allow multiple class defs?

Fred (Image x) = class { ... };

if a func has many RHS and the last RHS uses destrucuring, generate a
final def with
probably only useful for trivial classes

- what about

fred (list x) = ...;
fred (complex x) = ...;

ie. allow names of builtin types as well as class names

maybe:

fred a b c
= error "no def of fred matches args a b c";
fred (is_list x) = ...;

- error if more than one def of fred has no destructuring
- error if defs don't all have the same number of args
- error if a def with no destructuring isn't the last def
ie. a predicate before the arg, as well as a class name?

- do we allow eg.

fred [a, b ..] = a + b;

equivalent to

fred a:b:x = a + b;



- remove remove prefs workspace stuff?

things like max heap size should be settable ... maybe pres are useful?

- try < > in the image titlebar

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('nip4', 'c',
# ie. a major after nip2 8.9 for workspace save file versioning
version: '9.0.14',
version: '9.0.15',
license: 'GPL',
meson_version: '>=0.64',
default_options: [
Expand Down
Loading