On Apr 6, 10:18 am, Aleksej Saushev <a...@[EMAIL PROTECTED]
> wrote:
> In every applicable sense, dynamic, static, or weak, there's no
> character type in Forth.
Why did you leave out strong? Normally "weakly typed" means "not
strongly typed", so once we've established, as we have, that CHAR is
an abstract data type, saying its "not weakly typed" is identical to
saying "it is strongly typed". And I would argue ... indeed, will
argue, below ... that Forth-94 abstract data types are NOT strongly
typed in ANY sense of the word.
The character type in Forth-94 is weakly typed, as weakly typed is
commonly defined in Computer Science. However, I understand that in
order to "win" the argument, you seem to be prepared to redefine each
and every term used, I have to take into account that since weak
typing is the opposite of strong typing, and since strong typing has a
wide variety of definitions, weak typing has an equally wide variety
of definitions.
From Wikipedia, which is an excellent source for this kind of
question, because furious arguments over the meanings of terms are,
first, won or lost in terms of references to sources, rather than "gut
feelings", and when there are conflicting sources are usually resolved
by listing both meanings and noting that there are different sense
used in different contexts.
However, the straightforward point to bear in mind is that since CHAR
is an abstract data type, under the commonly accepted definition, that
means that if it does not qualify as strongly typed, in any of the
follow senses, that makes it weakly typed in that sense.
http://en.wikipedia.org/wiki/Strong_typing#Meanings_in_computer_literature
QUOTE
Some of the factors which writers have qualified as "strong typing"
include:
* Static typing as opposed to dynamic typing. In a static type
system, types are associated with variable names (usually when they
are declared) rather than values (usually when they are created). The
types may be inferred by the compiler and/or provided as annotations.
UNQUOTE
Clearly the CHAR is not strongly typed in this sense, so using
strongly typed in the sense, it is weakly typed.
QUOTE
* The mandatory requirement, by a language definition, of compile-
time checks for type constraint violations. That is, the compiler
ensures that operations only occur on operand types that are valid for
the operation.
UNQUOTE
Clearly the CHAR is not strongly typed in this sense, so using
strongly typed in the sense, it is weakly typed.
QUOTE
* Type safety; that is, at compile or run time, the rejection of
operations or function calls which attempt to disregard data types. In
a more rigorous setting, type safety is proved about a formal language
by proving progress and preservation.
UNQUOTE
Clearly the CHAR is not strongly typed in this sense, so using
strongly typed in the sense, it is weakly typed.
QUOTE
* Disallowing type conversion. Values of one type cannot be
converted to another type, explicitly or implicitly.
UNQUOTE
Clearly the CHAR is not strongly typed in this sense, so using
strongly typed in the sense, it is weakly typed.
QUOTE
* Some authors reserve the phrase "strongly-typed language" for
languages that omit implicit type conversion, that is, conversions
that are inserted by the compiler on the programmer's behalf. For
these authors, a programming language is strongly typed if types must
be converted by an explicit notation, often called a cast.
UNQUOTE
Clearly the CHAR is not strongly typed in this sense, so using
strongly typed in the sense, it is weakly typed.
QUOTE
* The absence of ways to evade the type system. Such evasions are
possible in languages that allow programmer access to the underlying
representation of values, i.e., their bit-pattern.
UNQUOTE
Clearly the CHAR is not strongly typed in this sense, so using
strongly typed in the sense, it is weakly typed.
QUOTE
* A complex, fine-grained type system with compound types.
UNQUOTE
Clearly the CHAR is not strongly typed in this sense, so using
strongly typed in the sense, it is weakly typed.
QUOTE
* Fixed and invariable typing of data objects. The type of a given
data object does not vary over that object's lifetime. For example,
class instances may not have their class altered.
UNQUOTE
Clearly the CHAR is not strongly typed in this sense, so using
strongly typed in the sense, it is weakly typed.
QUOTE
* Strong guarantees about the run-time behavior of a program
before program execution, whether provided by static analysis or
another mechanism.
UNQUOTE
This is the only one where there might be some dispute, however the
critical point is that if there are strong guarantees about the run-
time behavior of a program, it is provided by testing of the behavior
of each word in the system, including regression testing after
modifications, and not by the type system. So, in the sense meant by
the above, clearly the CHAR is not strongly typed in this sense, so
using strongly typed in the sense, it is weakly typed.
So CHAR is weakly typed in *every sense of the use of the term* in the
literature that respects the most common definition of an abstract
data type. If a discussion in the literature defines both strongly
typed and weakly typed explicitly and with a definition that excludes
some abstract data types, it is normally in the context of the range
of possibilities in a particular programming language or family of
languages ... and so it would not be surprising if you took those
definitions out of their intended context and dropped them into a
different context and the definitions did not turn out to be
exhaustive.


|