8.22: adda/lexicon/allowed characters in identifiers:
. if the allowed characters in an identifier
could include the dot,
then there could be confusion in places,
as to whether the dot was declaring a var:
eg, what if you have the name x.F.int,
and then -- forgetting you did that --
decided later to define F.type ?
. now x.F is ambiguous:
are you declaring x to be F.type?
or are you referring to x.F.int ?
. therefore, the allowed identifiers are
first character is a letter
or the character (_);
and, subsequent characters are alphanums
or the characters (') (_) (-);
anthing else gets put in a box:
eg, [x.F].int; .
2012-11-17
Subscribe to:
Post Comments (Atom)
adda/lexicon/names that include dots:
ReplyDelete8.22:
. if there are a lot of dots in a pathname,
then the reader has to memorize all the typenames
in order to differentiate these examples:
path.x.int -- a declaration of x as int;
path.x.not-a-type -- evaluation of not-a-type .
. nevertheless, we don't want to represent url's as strings;
our syntax for symbols should include url's .
. the places where dotted names don't need to be boxed,
include the few places where there is a special context,
like when a var is expecting a web name,
then we can assign such a var
something like $subdomain.domain
and expect that to be interpreted as any of
http://subdomain.domain.x
where x is {com, org, net, gov, ...}
8.24:
. in places where a webname is not expected,
then the popular top-domain name must be included;
and if the top-domain name is not popular
then the "( //) is needed to make clear it's a webname .
. if ( //x.y finds nothing), it's then assumed that
//x.y means //*.x.y -- like googling (site:x.y) .
. the other place besides webnames to expect dots
is the names of enumerations:
all of these are preceded by a $ (symbol of value)
(this is to avoid putting them in quotes,
and getting them confused with character strings).
11.17: correction:
. the ($) preceding a symbol is needed only when
the symbol is not declared,
so that we can talk about symbols
without having to represent them as strings:
"(a string) vs $[a symbol] .
. declared symbols contain values;
whereas undeclared symbols are values !
(values of type: symbol).
. if it's not clear what type
an enum value belongs to,
it can be qualified by type::value .
8.24: adda/lexicon/dots in names/
ReplyDeletedeclared adjectives and adverbs:
. the other place to allow dots in names
is as a sort of parameterization
-- the same way english does:
seeing easy.chair we expect that
easy has been declared to be a modifier of nouns .
8.28: adda/ad.type:
. type .ad declares a symbol to be
either an adjective or an adverb .