Skip to content

Add support for chained API syntax in Wave #161

@LunaStev

Description

@LunaStev

Background:

Currently, Wave does not support chained function or method calls such as object.method1().method2().
Chained APIs improve readability, especially when dealing with operations that return intermediate values.

Expected Behavior:

Allow multiple method calls or function-style chains in a single expression.
For example:

var text: str = " hello ";
var result: str = text.trim().to_uppercase().slice(0, 3);
  • Each call should return a new value or reference to allow the next method in the chain.

  • Support both built-in functions and user-defined functions with return values.

User Scenarios:

  1. A developer wants to transform a string with multiple operations in a single expression.
  2. A library function returns a struct, and the user calls a method on that struct immediately.
  3. Improves readability for pipelines such as read().parse().validate().store().

Additional Information:

  • Language version: - (not yet assigned)

  • Target branch: develop

  • This will require changes to the parser and expression evaluator, possibly also type resolution.

Metadata

Metadata

Assignees

Labels

discussionIssues that require a technical or community discussion.enhancementA request for a new feature or improvement.feature requestA request for a new feature or functionality.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions