Skip to content

False domain error reported when name of expected verb instead refers to a noun #207

Open
@cchando

Description

@cchando
   f=: N+]
   N=: 3
   f 1
|domain error in N, executing monad N
|       f 1

Because N wasn't defined at the time that f was, it was assumed to be a verb. When the execution of [N as a verb] was attempted, an error was raised because it instead referred to a noun.

This is reported as a domain error, which it is confusing; it should be interpreted as a value error since it concerns N's part-of-speech only. It might say e.g.

|value error in N, executing monad N: N was expected to be a verb, but is defined as a noun
|       f 1

Perhaps better would be to instead attempt to interpret N as a noun and apply the containing expression accordingly, upon the interpreter seeing that N is a noun (or just as a general fallback to attempted verb interpretations). This latter suggestion might not be feasible, depending on implementation details.

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