Skip to content
This repository was archived by the owner on Jun 14, 2022. It is now read-only.
This repository was archived by the owner on Jun 14, 2022. It is now read-only.

disallowing map, vector and open identifiers is a bad idea #19

@shviller

Description

@shviller

A seemingly innocuous

--# assume File.open:	method() --> boolean
--# assume File.write:	method(string, integer?) --> (boolean, string?)
--# assume File.close:	method() --> boolean

leads to

.\love.lua.kailua:35:17: 35:21 [Error] Expected a name, got a keyword `open`
35 | --# assume File.open:   method() --> boolean
   |                 ^^^^

Similarly to open being a rather popular name, map is a widely-used function with entirely idiomatic semantics (see Underscore.lua, Penlight, Moses, Lua Functional, Lume...), and given that you'd need to use --# assume on it on nearly any invocation (similarly to #18), kailua's inability to stomach any annotation that mentions map as an identifier severely limits its usefulness.

vector also systematically occurs as an identifier name in certain subject domains.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions