Re: Seeking computer-programming job (Sunnyvale, CA)

S

Seamus MacRae

Paul said:
Context matters. In some contexts (x y) is two parameter names. In
some contexts, it's a name and a value.
In some, it's a function and argument. In some it's a variable name
and type. In some, it's just data - a two-element list.

Apparently including in at least one pair of contexts that look the same
to human eyes.
[The type system is far more flexible than Java's, too!
One you can totally ignore or circumvent at any time tends to have
that trait, yes.

If you ignore and circumvent the type system, you either get errors at
compile time (if Lisp can detect what you've done), errors at run time
(if the compiler is set to perform run-time checks), or segfaults and
other misbehaviour at run-time (if it isn't)

What you are describing is the behavior of a statically-typed language
like C.

Without the ability to get direct access to machine pointers like you
can in C, and then alter their values arbitrarily or increment them, nor
the ability to deallocate an object still referenced, I would consider
any occurrence of a segfault evidence of an implementation bug.

Certainly if a JVM ever segfaults, and it isn't due to buggy
non-standard-library native code called through JNI, then it is
indicative of an implementation bug.
Just a pointless example. Extend it to whatever range you like.
[And any random value that fits the specification, from a source that
knows nothing about your "class of your own devising" should test as
being of that type]

For that, you'd need either to make your own higher-level type system
with explicit predicate functions, or else have a conversion function
that returns a value as a particular type if possible and throws an
exception otherwise.
It'll do /that/ much in Lisp

Run-time checks I'll grant you.
but it's not likely to compile better code with that information,
etc., the way it can if it knows you have an integer that fits in a
hardware register, etc.

This is an excellent argument in favor of using a Java- or C-like
language possessing modulo types like int, short, and long, rather than
a language that (conceptually, at least) has all numbers be bignums.
(Smalltalk is the other noteworthy culprit here, though it helps that
all small-enough integers are automatically made instances of
SmallInteger, which is a bit smaller in capacity than the machine-native
int since a bit is reserved for flagging whether the data stored is a
SmallInteger or a pointer. The pointer is also shortened, but this just
means Smalltalk has to allocate everything at an even address and mask
off the bit or else have that bit be a zero for pointers and a one for
integers instead of the other way around. Typical systems prefer to
allocate everything at addresses that are multiples of larger numbers,
like 4 or 16, anyway. Java objects are all word-aligned in memory, too.)
 
S

Series Expansion

And Java's problem since we are stuck with him.

Incorrect. Nowhere have I claimed to dislike Lisp. Dislike of Lisp is
not a problem in need of correcting. Nor am I a problem in need of
correcting.

Arne, you are being exceptionally rude. Please desist.
 
S

Series Expansion

Series said:
Series Expansion wrote:
Says someone who evidently has never heard of junit [sic].
Spelling counts.
These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, "Lew".

Stating that spelling count

does not constitute a rational argument in favor of either Lisp or
Java.
Maybe you should read what you reply to.

These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, Arne.
I am sure a lot of cljp'ers would have been happy not to see it !

These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, "Lew".
 
S

Series Expansion

the definition of the british word 'fanny'

is irrelevant.
don't assume that because two words sound identical, they mean the same
thing or that their definitions have anything in common.

I did not, and your admonishment based on a faulty assumption is quite
rude.

The only thing I assumed was that a) a Lisp macro invocation gets
replaced with some code for the compiler to compile in it place, and
b) in that code certain placeholders are replaced by the macro
arguments.

This has since been acknowledged as true by several of the
comp.lang.lisp people at various points.

That you continue to argue against it suggests that you are
irrational.
 
S

Series Expansion

On May 20, 3:49 pm, Series Expansion <[email protected]> wrote:
[an attribution is missing here]
These tiresome repetitions of a formula do not constitute any evidence

These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, Adlai.
Series and Seamus, as the two of you keep demanding more and more
"evidence" and examples of "impossible" things, we keep providing
them.

What you keep providing are assertions, personal attacks, and
irrelevancies like this latest post of yours, Adlai.

When (if) I do see some actual evidence I will let you know.
You keep dodging the fact that our examples answer your
questions by posing newer and more ridiculous misunderstandings of

I do not.

These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, Adlai.
Oh and Seamus, thank you for coming back. Series's humour was starting
to dry up...

This post is in reply to me, not Seamus, so this remark is illogical.

Not to mention that these tiresome personal attacks do not constitute
rational arguments in favor of either Lisp or Java, Adlai.
 
D

duane

(e-mail address removed) wrote:
Alessio Stalla wrote:
[snip]
Please stop posting five minutes after I post, in the interests of
letting me get caught up so I can move on to other tasks. I do have
other things to do than defend myself against you and your pals, you
know, and it is disrespectful to keep me jumping like this without any
time to even catch a breather. Furthermore, please try to limit your
posts to a reasonable length. This one isn't as ludicrously long as some
of your recent posts have been, but it isn't exactly short either.
I just answered another of your posts, and this precisely demonstrates
my point there; you are not in control in this conversation
I'm not sure I care for your threatening tone.
No threat.

You implied a threat to disrespect my wishes and continue to publicly
badmouth me, right there in that quoted text.

You who are so concerned about losing respect have already done so,
and long before I entered this conversation.
There was no threat. The disaster you created for your reputation was
intricately woven by you in this whole thread.
That would be unwise.

Have it your way.
So you claim. I think you would not be making that claim unless it
served your purpose. Since your purpose seems to be to have the last
word and to do so at my expense, and since that would have undesirable
consequences for me, it follows that you are probably attempting to
deceive me into pursing a poor strategy that will enable you to have
that all-important last word.

Therefore I should ignore what you are suggesting.

You have not been able to do so yet.
Once again you err. I am not interested in controlling people's
viewpoints. I had some things to say about Lisp versus Java.
Subsequently, I have endeavored to correct the public record regarding
my own person, after several people set about to doctor that record. At
first I believe they did so inadvertently, by arguing about Lisp in ways
that unfortunately insinuated things about me that were inaccurate.
However, it is now apparent that at least some of you are doing it
deliberately, though you formerly were either silent or doing it
accidentally.

Shame on you.

Regardless, you are all entitled to your personal opinions and
viewpoints and I would not dream of trying to change those by force.
However, what you publish in writing about me is another matter entirely
and I am entitled by law to some influence over that.



Yes, it does. Why are you accusing me of lying, when I have no motive to
do so and especially when the evidence clearly supports what I said?

I've never accused you of lying. You seem to have an obsession about
the issue of lying. You been telling me I've accused you of lying,
and I never have. It seems if we have a difference of opinion, you
think I'm accusing you of lying.
In other words, you suggest that I should lie about whether I've
actually caught up on usenet, by claiming to have done so when I have
not? How illogical.

I'm not suggesting you lie to yourself. I'm not suggesting you think
of yourself of being caught up on usenet when you're not. I'm
suggesting that one way of being done with usenet is to _not_ catch
up, but to simply be done with it. Of course it's illogical to you,
because you have a compulsion to "catch up", and you can't help
yourself.
No, they would not. None would ordinarily prefer that the public record
contain an erroneous negative statement about them than that the public
record contained no such statements.

Ah, but because the public record already has the sheer volume of your
posts in it, it already shows the unpleasantness that you have created
for yourself, just for the volume of it. Your reputation has been
damaged irreparably by yourself and no other. There's nothing you can
do to fix that now.
The rest of your insulting and vaguely threatening post has been deleted
unread. Have a nice day.

"Vaguely threatening?" Well, I would wish you a nice day, but it
seems you're not have a very nice day, with all of the threats and
accusations leveled against you, and with all of the catching up you
must do.

Have a nice day anyway.

Duane
 
P

Paul Foley

Seamus MacRae said:
Apparently including in at least one pair of contexts that look the
same to human eyes.

But not to human eyes attached to a human brain that understands what
it's looking at.
[The type system is far more flexible than Java's, too!
One you can totally ignore or circumvent at any time tends to have
that trait, yes.
If you ignore and circumvent the type system, you either get errors
at
compile time (if Lisp can detect what you've done), errors at run time
(if the compiler is set to perform run-time checks), or segfaults and
other misbehaviour at run-time (if it isn't)

What you are describing is the behavior of a statically-typed language
like C.

Without the ability to get direct access to machine pointers like you
can in C, and then alter their values arbitrarily or increment them,
nor the ability to deallocate an object still referenced, I would
consider any occurrence of a segfault evidence of an implementation
bug.

It isn't a "bug" if you deliberately caused it by going out of your
way to circumvent the type system.
This is an excellent argument in favor of using a Java- or C-like
language possessing modulo types like int, short, and long, rather
than a language that (conceptually, at least) has all numbers be
bignums.

Indeed...or Lisp, which, as I've said, can also declare types like
restricted integers and such; if it knows (either through type
inference or explicit declaration) that you're using values that fit
in machine integers, the compiler can use hardware instructions to
operate on them.
 
S

Series Expansion

Yes.

The fact that defmethod is a macro does not mean it remotely
modifies any code.

In and of itself, you are correct: it does not. However, I did not
base my remarks solely upon its being a macro. I also used your own
statement that it could be used to add more dispatches to the dispatch
table from anonymous.c.lisper. Taken together, those statements imply
that this particular macro can and does modify code.

So either it can, or you are incorrect about it adding more
dispatches, or you are incorrect about it being a macro.
What you mistakenly see as "tables"

I do not. I correctly see them as tables.

The code at issue is:

This is quite clearly tabular data and anonymous.c.lisper himself
stated that it controls the dispatch of frobnobdicate method calls.
These observations, taken together, suffice to imply that it is a
dispatch table.
You can write no such "table" as you name them, and write a bunch of
defmethod forms instead - it's the same.

If you did that, then where would the macro put the dispatches?
The real "dispatch tables" are not apparent in source, like they
are not in Java: they are state maintained in the system's
internals, just like in Java, C++ etc.

If this were true, then the defmethod macro could not function in the
manner claimed. The macro can only replace source code with other
source code at compile time. For it to modify a dispatch table,
therefore, that dispatch table must be located in the source code. Its
only alternative is to generate run-time instructions to allocate and
construct dispatch tables, which has two consequences:

1. How are many uses of the same macro with the same method name
throughout the code base to coordinate? They must create and use a
single dispatch table, not one each, for that sort of scheme to
work.
2. The dispatch tables are then being "faked" using ordinary
user-accessible run-time data structures, rather than being true
dispatch tables analogous to Java's or C++'s, which the compiler
and runtime generate and use and which are not user-accessible,
except, in C++, via unwise pointer manipulation. In particular,
the Lisp dispatch tables would not be "state maintained in the
system's internals, just like in Java, C++ etc."
Where is it written that it *silently* works incorrectly?

Two levels above:

This implies that it will quietly do what is unlikely to be what the
programmers intended, without generating any overt warning or error
message. This is commonly called "failing silently". Instead of a
prompt diagnostic, the result is a logic error in the program, and a
greater amount of effort needed subsequently to debug this error.
All implementations I know of warn the user in case of redefinition of a
method.

That contradicts the previous, quoted statement about it "just"
overwriting a method.
I make no sense of this. I'm only able to understand that your notion
of "package" is something that has no resemblance to what a package is
in Lisp.

If that is the case, it can only be because Adlai was inaccurate in
describing packages to me.
A package is a container of symbols, period. I repeat myself:
a package does not concern itself with functions, classes, variables,
methods, etc. etc. etc.

This is contradicted by statements made elsewhere by yourself and
others, particularly, one claiming that a function and a class in the
same package can share the same name. If the package did not
distinguish among these, then that could not be the case.
Still makes no sense to me...

Since that is based on a description of Common Lisp package behavior
that Adlai posted, you should endeavor to figure out which one of you
is apparently mistaken about packages. At this time I have no basis
for choosing either of your interpretations over the other.
What is a public generic function? What is a public class? What is a
private method?

Public = exported. Private = not exported.
This is not Java.

I did not state otherwise.
*symbols* in a package can be internal ("private") or exported
("public"). No other kind of Lisp object I know of, besides
symbols, bears the concept of "public"/"private".

Perhaps not directly. But to make a distinction between a method being
private or its name being private seems to be to make a distinction
without a difference. There is a Java analogue:

private static final Integer ANSWER = Integer.valueOf(42);

One would say that the name ANSWER is private, but also that the field
was private. Which it is. It is true that one could get a reference to
the Integer object passed around, so the object itself is not private,
but the field is.

With a private method and methods as first class objects, one would
expect that the method could not be gotten from outside via its name,
but could be via direct reference if one were to obtain one.

Furthermore, in

private class Foo implements Runnable {
public void run () { ... }
}

it may possible to get ahold of a reference to an instance of this
class, though it is private, into a variable of type Runnable. From
there, the run method could be called. The class being private, the
run method is effectively not exported, but it's still callable,
through polymorphic dispatch.

So whereas there is arguably a distinction to be made, in practice
it's a pointless one: "the method is private" is more or less
synonymous with "the method's name is private".
No. To add a method you call defmethod, period. No access to source
required.

You're forgetting that, by your own prior testimony, the defmethod
macro in turn adds the dispatch entry. So whether you do it by hand,
or have the macro do it for you, the dispatch table must be accessible
to you.
Again, no such table exists in source.

Again, macros operate by transforming source, so if this were true,
the defmethod macro could not function in the manner you have claimed.
"to do something that otherwise couldn't be done" is not to be taken
literally.

That is not a valid argument against my reasoning. It is, rather, a
"cop-out". It is also an arrogant presumption on your part, purporting
to be able to speak for gugamilare as you have just done.
No offense intended, but haven't you thought that maybe the
contradictions are between your assumptions and what other people say
to you?

Of course not, since the contradictions in question are contradictions
between a statement made by one of you and a statement made by another
of you. No assumption that I made could alter either statement in any
such case -- you each said whatever you said.

For instance, supposing you were to say that the sky was green, and
gugamilare that it was blue, these statements would contradict,
independently of my own personal opinion on the matter or of any
assumptions on my part.

I took the liberty of trimming a large volume of quoted material that
was left unaddressed, but untrimmed, leaving only a small portion. Was
a part of your post mistakenly omitted?
 
D

duane

[I only have a couple of points I choose to answer here]

(e-mail address removed) wrote:

...
This quite clearly cannot be correct. The only way to remove the
misinformation would be to destroy Google's servers, and their backup
tapes. It follows from the illegal, vandalous, and infeasible nature of
such a task that in practice one cannot remove it at all, and must
instead combat it in some other way, perhaps by spreading an equal and
opposite message, in some sense of the phrase "equal and opposite".

Yes, I must correct myself here; I was speaking as if to someone who
hadn't posted hundreds of messages to a newsgroup, and so I admit that
I am wrong about what can fix your reputation. It's the "equal and
opposite" part that is doing your reputation in. The sheer volume and
tenacity of your posts has soiled your reputation beyond repair, and I
retract my advice; there really isn't anything you can do to fix your
reputation. I would say "do whatever you wish", but you're going to
do that anyway.

...
Removing myself from the conversation would only result in it continuing
"behind my back", as it were, hardly a desirable state of affairs from
my point of view.

Yes, I'm starting to see how paranoid you are.

...
I am a vertebrate. Please be more careful in the future when making wild
guesses about an organism's phylogenetic status.

Apparently, you are not old enough or well-connected enough to
remember the "Kung Fu" TV series. The term was endearing, in the same
way you have quoted such endearing phrases from Yoda in Star Wars.

Oh, well. I guess I misjudged your savvy.

Have a nice day.

Duane
 
S

Series Expansion

- Running some code in a dynamic context established by the macro
(e.g. some variables locally bound, some local functions defined, ...)

A function that takes closure arguments could also, of course, define
local functions and contain local variables.
- Introducing new syntax (for example for DSLs).

Smalltalk appears to support DSLs fairly well using closures. Most of
its control structures are implemented within Smalltalk using
closures.
- Moving some computation at compile time.

Calc.exe and copy-and-paste can accomplish that.
- Changing argument evaluation rules.

Is this useful though?
- Transforming user code (e.g. to Continuation Passing Style).

Functions that acted on Lisp code as data could accomplish this,
reading Lisp code in one style and outputting the transformed code to
a disk file. This would be safer than an in-place transformation, too,
since it would preserve the original.
 
S

Series Expansion

You've completely ignored GENSYMS.

I have not. What you described affected the storage allocation of an
object referenced by a variable. This has no impact on collisions
among the names of variables when the compiler parses the code that
has been transformed previously by the macro.
Lisp macros execute code which instructs how to produce the
expansion code
True.

and thus are able to avoid variable
capture, multiple evaluation, and all the other
problems you mentioned.

False. That the macros can execute code does not help much here. A
macro's output is some function of the macro's arguments, but no
function of its arguments can compute a safe variable name. Suppose to
the contrary that it could; that, with particular arguments, the macro
decided on "foo" as an internal variable name to use. Now place a call
to that macro in a function that has a local variable named "foo" and
use the same exact arguments in the call, and you will have a variable
collision. The same could be done for any arguments and any variable
name computed as "safe" given those arguments.

Thus we have arrived at a contradiction. Your hypothesis that a macro
exists that can do as you have described has been disproven.
As far as I can tell, you're replying to every single post.

It is what I have read, not what I have replied to, that you were
complaining about.
It would be a better use of everybody's time if you just ignored the
irrelevant posts, and only answered the relevant ones.

The problem with that is that insulting posts, while irrelevant to
Lisp macros, are not irrelevant to me personally.
Also, it does seem to me that you haven't put much effort into
understanding the Lisp package system or CLOS.

I have put precisely as much effort into doing so as you have put into
describing them, since I have read what you have written about them.
If you have not done a very good job of explaining them in terms a lay
person would understand, then that is hardly a basis for concluding
something negative about me.
The package system, for one thing, as has been said before, is just a
package of SYMBOLS. That's all. Packages don't store code within them,
just names of stuff.

Nobody asserted that they stored actual code. But they organize it,
indirectly by organizing the names of parts of the code. Furthermore,
it was indicated elsewhere that they distinguish names of functions,
names of classes, names of variables, and the like from one another,
in that a class and a variable, say, can have the same name and be in
the same package.
People have mentioned gensym, which is completely relevant to macros,

But, as I have demonstrated, it is irrelevant to the capture problem.
Unless of course you have misdescribed them, in which case they might
be relevant without that having been made apparent to me.
and if I recall correctly, you're only replied once, saying that
gensyms are impossible

Not impossible, irrelevant. I have explained why a macro cannot
compute from its arguments alone a guaranteed-safe variable name. You
responded by describing something apparently to do with run-time
memory allocation. That is not a debate -- it is a farce.
I cite a page on Peter Norvig's site:http://www.norvig.com/java-lisp.html
He talks about a study done in a few different languages. One of the
results was that Lisp code for the test program was produced within
hours, while many of the submissions in other languages took days.

What was the nature of the test program? This kind of thing can very
easily be biased, even inadvertently, by the selection of a test
program suited to a particular language's strengths. For example, the
wget source code is lengthy and an equivalent tool can be implemented
in Java in a handful of lines of code, because the Java standard
library includes HTTP transport and URL handling. This does not prove
Java superior to C. Nor does the relative ease with which one could
code an OS kernel in C compared to Java prove C superior. A string-
manipulation and pattern-matching heavy test program would produce the
ranking perl, ruby, Java, C. Device drivers, C and C++ ahead of
anything else. Heavy math work, possibly C, C++, or Java, or a special-
purpose language like that contained in Mathematica, ahead of most.

Anecdotes prove nothing and studies that could easily have been
(unintentionally or otherwise) biased prove little more. A broad study
with a large sample size and a large variety of "test
programs" (actually, sets of requirements, with freedom of
implementation) would be needed before one could possess data
conclusive enough to pronounce one language faster or otherwise
superior to another, except for specific categories of programming
problem or specific problem domains.
 
S

Seamus MacRae

(e-mail address removed) wrote:
Alessio Stalla wrote:
[snip]
Please stop posting five minutes after I post, in the interests of
letting me get caught up so I can move on to other tasks. I do have
other things to do than defend myself against you and your pals, you
know, and it is disrespectful to keep me jumping like this without any
time to even catch a breather. Furthermore, please try to limit your
posts to a reasonable length. This one isn't as ludicrously long as some
of your recent posts have been, but it isn't exactly short either.
I just answered another of your posts, and this precisely demonstrates
my point there; you are not in control in this conversation
I'm not sure I care for your threatening tone.
No threat.
You implied a threat to disrespect my wishes and continue to publicly
badmouth me, right there in that quoted text.

You who are so concerned about losing respect have already done so

I cannot have lost your respect, for clearly I never had it to begin with.
There was no threat. The disaster you created for your reputation was
intricately woven by you in this whole thread.

These are lies.
Have it your way.

If that is your wish, why are you endeavoring to prevent that exact outcome?
You have not been able to do so yet.

I have indeed. Since you have suggested that I shut up, and I have
clearly not shut up, then I have indeed not followed your suggestion.
I've never accused you of lying.

You just did. If I say a statement and you reply with "not at all" you
are implying that I told a falsehood. This should be apparent to anyone
with even the must rudimentary grasp of logic.
You been telling me I've accused you of lying, and I never have.

You have indeed.
It seems if we have a difference of opinion, you think I'm accusing
you of lying.

A difference of opinion? You have explicitly contradicted factual
statements from me, including statements about my own beliefs that I
should know much more about than you do. That is, essentially, calling
me a liar.
I'm not suggesting you lie

Yes, you are.

I had originally written:
If people continue to flood the newsgroup with more incorrect
postings, then it makes it difficult to get caught up and be able to
say "there, I'm done" and move on to another task.

You suggested that I say "there, I'm done" prematurely. Since I would
know whether I had actually caught up or not, I would then be saying one
thing while knowing a contradictory thing. It follows that you suggested
that I lie.
I'm suggesting that one way of being done with usenet is to _not_
catch up

You are now. You were not before. And no, I shall not stop catching up
simply because you want me to. In fact, given your behavior and apparent
hostility, that you apparently want me to is an excellent reason for me
to keep catching up.
Ah, but because the public record already has the sheer volume of your
posts in it

My posts are not at issue here. The posts discussed immediately above
are those, like yours, that make incorrect negative statements about me.
Your reputation has been damaged irreparably by yourself and no other.
There's nothing you can do to fix that now.

I do not take kindly to people that threaten me. I strongly recommend
that you desist from doing so.
"Vaguely threatening?" Well, I would wish you a nice day, but it
seems you're not have a very nice day, with all of the threats and
accusations leveled against you, and with all of the catching up you
must do.

And you are partially responsible.
 
S

Seamus MacRae

Paul said:
But not to human eyes attached to a human brain that understands what
it's looking at.

This is another example of a pointless and irrelevant personal attack.

Blow it out your USB port.
[The type system is far more flexible than Java's, too!
One you can totally ignore or circumvent at any time tends to have
that trait, yes.
If you ignore and circumvent the type system, you either get errors
at
compile time (if Lisp can detect what you've done), errors at run time
(if the compiler is set to perform run-time checks), or segfaults and
other misbehaviour at run-time (if it isn't)
What you are describing is the behavior of a statically-typed language
like C.

Without the ability to get direct access to machine pointers like you
can in C, and then alter their values arbitrarily or increment them,
nor the ability to deallocate an object still referenced, I would
consider any occurrence of a segfault evidence of an implementation
bug.

It isn't a "bug" if you deliberately caused it by going out of your
way to circumvent the type system.

The point is that you should not be able to cause it in that way. You
cannot in a bug-free Java implementation, even messing with reflection,
setAccessible(true), and using Object references for everything. You can
completely subvert compile-time type safety and encapsulation and the
worst a bug-free Java implementation will give you is a Java exception
stack trace, unless you call into buggy C code through JNI. Even
directly hacking the bytecode in class files shouldn't enable you to
crash a properly-functioning JVM.
Indeed...or Lisp, which, as I've said, can also declare types like
restricted integers and such

Not the same thing. A Java int is intrinsically known by, and thus
easily optimized by, the compiler. However, if I were to take Java's
BigInteger and subclass it to create a version with a limited range,
contained within that of an int, and use it in my code, the Java
compiler could not optimize it because it would know nothing about it
save that it was a subtype of BigInteger.

Similarly, your Lisp compiler cannot know about a user-defined type in
any real detail, only perhaps what it's a subtype of and what its own
subtypes are. (Perhaps the macro processor can know more, because the
macros themselves can, but the backend that translates things into
machine code cannot.) A user-defined type might represent anything from
a small integer to a big collection of strings. The only way around this
would be for the compiler to have as much knowledge of the program's
global semantics as the human programmer. Yet compilers, almost by
definition as well as by technological necessity, concern themselves
only with local semantics.
 
S

Seamus MacRae

Yes, I must correct myself here; I was speaking as if to someone who
hadn't posted hundreds of messages to a newsgroup, and so I admit that
I am wrong

You are indeed, but it is not my messages that are at issue here; it is
yours, and others. The ones that misrepresent me that I was referring to
further above. My messages, by and large, are calm and rational and
attempt to be the voice of reason so I have no problem with their
remaining archived.
It's the "equal and opposite" part that is doing your reputation in.
The sheer volume and tenacity of your posts has soiled your reputation
beyond repair, and I retract my advice; there really isn't anything you
can do to fix your reputation.

Or so you claim. However, it is clear by now that your motives are
suspect, so nothing that you say in the way of "advice" can be taken at
face value. The content of my posts is above reproach. Their quantity is
irrelevant. What of the quantity and tenacity of your posts, and the
others that have attacked me? What's good for the goose is good for the
gander, so if, as you imply, posting a lot means you're a bad person*,
then you are all equally guilty and it's as much on record as in my case.

* I do not, however, actually agree with this assertion at all.
Yes, I'm starting to see how paranoid you are.

This is a pointless and irrelevant personal attack. This post contains
several pairs of posts, neither from me, where the second post insults
me, so it is apparent that there are individuals present in this thread
that are willing to attack me in their replies to one another, and not
solely in their replies to me. My ceasing to post would not alter that.
So what you call "paranoid" is merely a logical extrapolation from what
has already been observed.
Apparently, you are not old enough or well-connected enough to
[rest deleted]

Once again you respond to logic by lashing out with a personal attack.
This does not advance your case one iota. I suggest you read about the
fallacy of ad hominem arguments before continuing to post here.
Oh, well. I guess I misjudged your savvy.

You have apparently misjudged me completely. I have never initiated any
hostilities nor desired any antagonistic relationship.
 
S

Series Expansion

Macros never change the code itself. A defmethod form would add to the
generic function as it existed in the currently running Lisp image,
when the defmethod form was evaluated. However, it would NEVER alter
the code itself.

That IS "the code itself", albeit the object code itself rather than
the source code itself.
The expansion code generated by a defmethod form deals with adding it
to the generic function's dispatch. It even creates the generic
function if none exists yet.

How can it do so, if, as you claim, it doesn't alter the code? Recall
that the dispatch appears to be explicit in source code, to judge by
the example code posted by anonymous.c.lisper previously in this
thread.
The compiler emits warnings when things get redefined unexpectadly.

This is inconsistent with your own previous claim that it wouldn't
fail; "just" a method would get overwritten. The word "just" implies
that no other effects would occur. A compiler warning would be an
additional effect.
Also -- writing code like that is not a good idea, and I doubt would
ever be done in practice. That code is almost like writing x = 1 / 0.

How fortunate that we have macros to write code like that for us,
then. A few defmethods in the right places could invisibly amount to
the same thing as that, without being anywhere near as easy to locate.
If you're thinking of what happens when you override an existing
method with a defmethod form in your code -- the compiler will emit a
warning in that situation.

Again, we have now heard both statements that there will be a warning
and statements implying otherwise from you. It is not at all clear
which to believe.
Packages don't contain dispatch tables, they contain symbols.

This again. The point is that the dispatch table belongs to a generic
function, and that function's name is in some particular package. The
dispatch table thus effectively belongs to that package.

Most computer programmers consider the things named to belong to
namespaces however their names belong, as a convenient shorthand. Why
you Lispers apparently feel the need to remind people constantly that
only the names technically and directly do, I do not know, but it
complicates and slows down communication to eschew the useful
shorthand.
A dispatch table for a generic fn only exists within the Lisp image

This contradicts an earlier posting by anonymous.c.lisper.
This is why you need to understand the Lisp package system to critique
various aspects of the language that interact with it.

This is condescending. Moreover, it seems to try to impute blame to me
for supposedly not understanding something that you have done a
remarkably poor job of explaining coherently. I believe a remark about
stones and glass houses might be apropos; the inconsistencies in your
own side's position imply that you are misunderstanding things
yourselves. I on the other hand am understanding you perfectly, but
what you say you yourself sometimes subsequently disagree with.
If you've compiled some code, the definitions in it are reflected in
the running Lisp image. Packages control symbol references, however,
you don't have to import a package for references to symbols in that
package to work in code that the Lisp image is already running.

So some of this stuff only works if you load part of the program,
start that running, and then load the rest? That sounds like a recipe
for trouble, and for install and configuration headaches for end-users
even.
There's not really a public/private distinction in Lisp packages.

Exported/non-exported, public/private ... differences of terminology
only. This is no more cogent an argument against what I said than a
spelling flame would be.
Nope. DEFMETHOD takes care of that.

Whether you do it manually or you do it by employing automation, you
still do it.
DEFMETHOD does it. I couldn't for the life of me tell you exactly how,
but when CLOS was written 20-some years ago, they designed it well.

I have, as yet, seen precious little evidence to support that claim.
DEFMETHOD forms add to the dispatch table of a generic function,
without messing with source code, just by updating the Lisp image.

Macros are compile-time. How can one alter the running code, if it no
longer exists by the time that code begins to actually run?
You have static type checking on variables for which you declare
types, and you don't have it for undeclared variables.

That would mean that you have it. But it was stated previously that
Lisp is dynamically typed. The contradiction remains unresolved.
 
S

Series Expansion

On May 20, 11:32 am, Series Expansion <[email protected]> wrote:
[an attribution is missing here]
Altering the behavior of that not-yours code via macro is hardly a
successful evasion of my point. In fact it compounds it, for not only
are you still effectively altering the behavior of that code, but
furthermore, you are causing changes at remote locations in the code
base via macro use, which I previously contended was a hazard of Lisp
macros and which your group repeatedly denied could happen. Yet now,
when it suits you, you admit that it can, indeed, happen.

Actually, the DEFMETHOD macro does not alter the behavior directly, it
macro-expands to an ENSURE-METHOD function call. [rest of irrelevant
technical details deleted]

Whether it does it directly or indirectly, and how it does so, has no
bearing on the matter at hand.
So, the hazard of changing the behavior of an existing method is not
really associated with macros, it is just the hazard of redefining the
behavior of an existing function.

The hazard still exists. My complaints about macros were centered
around variable capture, not around function redefinition.
A good(most, at least all that I have used) Common Lisp implementation
warns you when this occurs so that you may take the appropriate action
and mitigate the hazard.

How will this work in a large-team development effort? Collisions in
team members' code and naming may cause this, without it being easy to
determine what should be changed or which calls are supposed to refer
to which version of the method.
Fortunately, the ADD-METHOD function does just that.

The issue then raised is the original one, regarding modifications
that "draw outside the box". Whether these modifications are carried
out by hand (as in anonymous.c.lisper's example code) or via macro or
via function does not materially alter the cause for concern.
It is possible to avoid both of the above issues.

No, it is not. Your argument that "'twasn't me that done it, 'twas the
macro I invoked!" would not hold up in a murder trial and it does not
hold up here.
If by automated tools, you mean the ENSURE-METHOD and ADD-METHOD
functions, I suppose that's correct.

And there it is.
How the internals of these functions actually operate is an
implementation detail that is only of concern to the implementers.

Not when it's scribbling all over my code, it's not.
If you'll expand on this statement or direct me to a previous post
that expands on it, I'll attempt to address it. The point you are
trying to make is not clear from the above information.

It was in reference to another branch of this debate, where the perils
of lacking static type checking were at issue. There have been recent
posts to that branch.
I was unable to find the specified behavior for a duplicate
specialized lambda list passed to the :METHOD option of DEFGENERIC. I
performed a little experiment in the implementation that I use and the
second method was ignored.

Silent failure confirmed. Thanks.
If you are using the :METHOD option to add methods to a generic
function, then they will necessarily be collected in one place, so
when you test your methods and observe the incorrect behavior, you will
know exactly where to look to correct the problem.

That presumes that the cause of the incorrect behavior will be readily
apparent. It may initially present as subtle logic errors, however,
that could conceivably result from any of a myriad of causes. This is
especially likely as a name collision like the hypothetical one
probably results from an attempt to create two distict, but very
similar methods. The effect of all intended calls to one going to the
other could therefore be quite small, though perhaps cumulative,
depending on how nonlinear the effects are.
In the CLOS, there are no such things as a private or public methods

This degree of pedantry is unproductive. But if you prefer, I shall
say a generic function whose name is exported, dispatching to methods
whose names are not, when called with certain combinations of classes
whose names are exported. Although from the length and cumbersome
structure of the preceding sentence I hope you will understand why
programmers of most other languages prefer the brevity of the terms
"private" and "public".
There is no need to manually add a dispatch entry, this is handled by
ADD-METHOD.

Who said anything about "manually"?
This entry is added by ADD-METHOD.

Automation is irrelevant to the issue at hand.
[ Snipped text that contained nothing addressable. ]

I suspect this is intended to imply a personal attack. That would
constitute shameful conduct on your part, however.
 
K

Kenneth Tilton

Then let them be misled. Right now, they get the wrong idea about
you, because they laugh at your inability to back down from an
argument. Only after you've mastered the art of walking away can you
master the art of controlling people's viewpoints.

Reminds me of a chat I had with one of the more intellectual bouncers
down at my sports bar. He said that whenever two guys start to get into
it he points out to them that they are about to turn off every girl in
the bar.

I forgot to ask if it works.

nsth, kt
 
S

Series Expansion

*sigh* I purposedly declared a global variable to show how my macro
DOES NOT use global variables!

That statement is not logical.
In fact, part of the output of the macro is

"Global variable?" NIL

NIL means false.

That the global variable's boolean value is false seems irrelevant.
The macro is checking whether the temporary variable
it introduces is globally bound, and finds it isn't - it cannot be,
since its name is guaranteed to be unique!

A macro can compute only a function of its arguments. To guarantee the
name be unique would require it to compute a function of the entire
codebase of the project that contains it. For a macro local to a
particular project, this would require the entire rest of the source
code to be contained in the macro's arguments. For a macro in a
library or other reusable module, this would entail granting the macro
powers of precognition.
As you see, user code is evaluated only once - the 3 is printed once -
no global variables are used, no variable capture can occur since the
*local* variable introduced by the macro - #:G622 in this case - is
guaranteed not to clash with any other variable.

As explained above, this guarantee is not possible to make. All that
is needed is to create a variable with the name #:G622 in the calling
scope and the same macro, given the same arguments, will cause
capture, since the variable name must be the result of the macro
computing some function of its arguments and since in the case of that
particular macro with those particular arguments the name thus
computed is #:G622.

It is not even possible to fix this by making the macro
nondeterministic or by giving it state that persists between
invocations. Without special hardware it cannot be made truly
nondeterministic. Pseudo-random number generation is the best that
could be managed, and devolves to case two, giving the macro
persistent state. But that, too, is impossible. Macros run at compile
time, and therefore have no ability to make use of run-time data
structures to maintain state. Indeed, you could engineer a collision
easily regardless, by compiling one source file using the macro in
question, noting the name the macro generated when it expanded, and
then authoring a new source file never before seen by man that used
the same name and put it into a scope visible at the call site, say,
the top level of the scope hierarchy. If this second file is then
compiled and the object code from the two compilations linked, the
collision occurs long after the macro had any opportunity to avoid it.
Is it clear now?

As mud.
 
S

Series Expansion

These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, Duane, Scott, and Thomas.
[rest deleted]

Ah, yes, the attacks.  If you're so tired of them, why don't you stop
them?

Because they are not mine to stop. As was noted in the post to which
you are replying, some of them were yours and others were by Scott and
Thomas. They are the ones you should ask to stop attacking me, after,
of course, stopping doing so yourself.
 
T

TomSW

You assume, incorrectly, that I am trying to learn something. Perhaps
earlier I was, but at the moment my goal is purely to set the record
straight

There's not much chance of that.

You put me in mind of this passage, which thanks to you I was prompted
to hunt down in full:

"A physician once remarked to me as a proof
of the exciting nature of anger, that a man when excessively jaded
will sometimes invent imaginary offences and put himself into a
passion,
unconsciously for the sake of reinvigorating himself; and since
hearing
this remark, I have occasionally recognized its full truth."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top