Skip to content

Builtin functions not loaded in loaded module #16

@Folyd

Description

@Folyd
// string_helper.ai

pub fn pluralize(word: str) -> str {
    // Simple pluralization logic
    if word.ends_with("s") {
        return word + "es";
    }
    return word + "s";
}

print(pluralize("apple")); // Undefined variable 'print'.
// hello.ai
// Import your module
use string_helpers;

let word = "apple";
let plural = string_helpers.pluralize(word);
print(plural); // "apples"

We run cargo run hello.ai get "Undefined variable 'print'` error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglangAIScript Language Syntax

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions