lambdalist

package
v1.75.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package lambdalist shares lambda-list validation between runtime and lint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvalidName

func InvalidName(s string) string

InvalidName reports why s cannot NAME a formal argument, or "" when it can. A keyword and the constants true and false are refused by LEnv.Put at bind time, so a function declaring one could never be called; saying so where the function is written puts the diagnostic on the definition a reader can fix. Control markers (&optional, &key, &rest) are a matter of position rather than of the name alone and are checked by Validate.

func Validate

func Validate(n int, name func(int) string) (int, string)

Validate checks n symbol names supplied by name without copying the list. It returns the offending index and the runtime diagnostic, or (-1, ""). Callers check that the list contains only symbols before calling Validate.

func ValidateLegacyKeywords added in v1.65.0

func ValidateLegacyKeywords(n int, name func(int) string) (int, string)

ValidateLegacyKeywords is Validate with keyword parameter names accepted, as they were through v1.61.0: each binds positionally like any other name. It backs the runtime's opt-in LegacyKeywordFormals override (issue #686).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL