Skip to content

Add named function arguments #7987

@Efnilite

Description

@Efnilite

Suggestion

Skript should add named function arguments, similar to languages like Kotlin.

Example:

function x(a: int, b: text):
  return length of {_b} * {_a} 

on load:
  set {_f::1} to x(a: 1, b: "nice")
  set {_f::2} to x(b: "nice", a: 1)
  set {_f::3} to x(1, "nice") # same behaviour as old

Why?

For functions with many parameters, it improves the readability of the arguments. Seeing x(a: 1, b: "nice") means you instantly know which values are passed to which parameters, instead of x(1, "nice"), where it is not explicitly mentioned.

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.

Metadata

Metadata

Assignees

Labels

PR availableIssues which have a yet-to-be merged PR resolving itcore taskTasks that may be handled only by the core developer team.enhancementFeature request, an issue about something that could be improved, or a PR improving something.functionsRelated to functionspriority: lowest"Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).

Type

No type

Projects

Status

Planned Issues

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions