isname/1

Tests whether a string represents a name (i.e. a string or an atom).

This is similar to the Visual Prolog predicate isname/1, except that it can take both strings and atoms as its argument:

isname(STRING) -(i)

isname(ATOM) -(i)

Remarks:

The isname predicate succeeds if the String or Atom is a <name>, according to Visual Prolog syntax. A name is any sequence of letters, digits, and underscores, beginning with a letter or an underscore.

Fail: Fails if StringArg cannot be classified as a variable following the rules for a Visual Prolog

Errors: No errors.

Examples:

isname("Leo")

Yes

isname("2Leo-the-Lion")

No

isname("_PER")

Yes

isname("jim")

Yes

isname("_")

Yes

isname("michael12")

Yes

isname(thisatom)

Yes