Kaz said:
["Followup-To:" header set to comp.lang.lisp.]
Taking it as a given that Complex should be a subtype of Number, how
else would you go about doing it?
Are you asking about implementation strategies about how to add
this ANSI CL feature to Seamus MacRae Imaginary Lisp.
No; there's no such thing as SMIL anyway. I was asking Pillsy to clarify
something that he wrote, and how he would do something. And since you're
not Pillsy, it is very odd for you to jump in at this point.
Yes really.
Lisp is the same way. Originally, everything had type.
In Lisp? Surely you jest. At base, it has no static types and precious
few dynamic ones (integer, maybe a few other numerics, cons cell,
string, symbol, nil, and little else).
Are complex numbers a subtype of numbers?
(subtypep 'number 'complex) -> T ;; Yes!
This seems to be checking some programmed-in notion of types, not
compile-time types of any kind. You could program this behavior in any
language.
Lack of static typing saves work in the type system too?
Maybe a bit. At the cost of lots of debugging later on, in big enough
systems.
There isn't a Lisp macro called THINK which will do this for you
I meant *think*. With your head! Maybe a bit of a foreign concept to you?
You keep asking people for rational evidence. Where is your rational
evidence that these errors are such a threat?
I have stated it repeatedly. You keep ignoring it.
I agree that there is a nonzero probability that you will be
confronted with an error like ``foo does not understand the method bar''.
Well, there we are. I guess we are now in agreement.
So why am I still apparently only 1/3 of the way through your
interminably long post?
1. How much of a threat is this? Can we quantify this risk in numbers?
Easy: what would have been caught in seconds at compile time, or even
instantly in the IDE when editing (red squiggly underlines: another
feature untranslatable to a box of pure ASCII), instead isn't caught
until run-time and possibly far from the true location of the error.
Seconds of debugging becomes minutes at best, hours at worst.
Say the downside is 30 minutes.
Now note that type errors are an estimated 30% of bugs. So nearly 10
minutes per bug, total, saved with static types.
2. What are the costs of preventing this problem with static typing?
A bit more up-front keyboard typing. Maybe more thought as to what
should be what and going where during design and coding, but that will
pay off as an investment down the line.
Are there risks, and what are they?
There's a risk you won't be able to mischievously sneak a Float into a
group of Strings...
You are asserting that there are no costs, or risks, only benefits,
No, I am not. I am asserting that they balance out in favor of static
typing.
Don't accuse others of having no rational evidence
Then get some and post it.
People who have actual years of experience with dynamic typing find that the
actual threat from type mismatch errors is small compared to the inconvenience
of working with static typing.
This is the kind of worthless anecdotal "evidence" that all too many
people mistake for the real thing. Of course, no scientist worth his
salt will take it other than with a grain of same, and no court of law
will accept this kind of claim as admissible testimony, on the grounds
that it's hearsay.
Macros are a part of compilation.
Macros are user-defined. Macro EXPANSION is a part of compilation,
probably one of the earliest parts.
What is the difference between, say:
synchronized (obj) { ... code .. }
and
(synchronized obj ... code ...)
Java's synchronized block construct is a de facto macro. The difference is
that it's hard-wired into the compiler.
You'll also find that all of Java's "de facto macros" lack multiple use
of any argument, and so don't run into the variable capture/global
variable/multiple evalaution trichotomy.'
The point is that the C generated by bison is
C, not assembly.
You're having problems with Bison and version control because you have no clue
what should go into version control and what shouldn't.
You're jumping to unwarranted conclusions about me. I don't have serious
problems with Bison and version control. I do anticipate there could be
serious problems with Lisp code rewriting the (foo foo) bits of itself
and version control.
I saw elsewhere in this thread that you were shown a screenshot of Emacs and
you still denied it was Emacs.
I was shown a screenshot and told by a known hostile entity and probable
liar that it was emacs, and the screenshot showed something that
resembled emacs the way the Eiffel Tower resembles a tea saucer.
The only Emacs is Seamus MacRae Imaginary Emacs.
I find that particularly unlikely to be true. I'm adding you to my list
of "probable liars" in this thread.
An organized reference manual for Seamus MacRae Lisp would be helpful,
instead of the collage assembled from these fleeting glimpses of
what it is about.
I'm sorry, but I don't know of any "Seamus MacRae Lisp". I doubt it
exists. If it does, you'll have to ask someone else about it -- the name
is a total coincidence and I don't know beans about it.