eignnx / eignnx/rellog

Module System

Open
#40 1 comment 0 reactions 1 assignee Claimed by @eignnx View on GitHub
builtin enhancement syntax
Dominant language
Rust
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Works toward #23.

Basically copy-paste Rust's module system into Rellog.

# Goal
Get this example working:
```ruby
# in shapes.rellog
[[imports
- circle::[circle_radius][circle_area]
- quads::
- self
- rectangle::[rect_width][rect_height][rect_area]
- square::[square_width][square_area]
]]

[[submodules
- circle
- quads
]]

[[exports
- [shape][area]
- circle
- quads
]]

[shape {square Width}][Area]
- quads::square::[SquareWidth][square_area Area]

[shape {rect RectWidth RectHeight}][Area]
- quads::[RectWidth][RectHeight][rect_area Area]

[shape {circle CircleRadius}][Area]
- [CircleRadius][circle_area Area]
```

```ruby
# in quads.rellog
[[exports
- square::'*'
- rectangle::'*'
]]

[[submodules
- square
- rectangle
]]
```

See full example [here](https://github.com/eignnx/rellog/tree/00dac6370e2f907f94fd335574554e51a56c5dda/examples/import-examples)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.