Skip to content

import support #74

@xela92

Description

@xela92

Hi, great project!

Currently, RAD scripts seem to be standalone and there is no way to reuse code or import data (e.g. JSON files).

This makes it difficult to organize larger scripts, share common utility functions and avoid copy-pasting code.

It would be great to have some import functionality.

Here's some examples of hypotetic syntax:

utils.rad

fn sum(a, b):
  return a + b

main.rad

import "./utils.rad"
import "data.json" as data

print(sum(2, 3))

x = json[].x
y = json[].y
z = json[].z

rad data:
    fields x, y, z

main.rad, alternative import syntax

import sum from "./utils.rad"

print(sum(2, 3))

Thanks for the cool project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions