S
Series Expansion
You already saw them. The only thing is that you don't understand them
because you don't understand Lisp.
I still have yet to see any. Certainly the above-quoted personal
attack fails to impress.
You already saw them. The only thing is that you don't understand them
because you don't understand Lisp.
ConteXt, before you flame me again for writing wrong English.
He meant that
a C macro is so much different from a Lisp macro that,
to understand a Lisp macro, you need not to take any knowledge you
already have using C macros.
[...]
It's strange to be told, repeatedly, that things I do routinely,
without a great deal of difficulty or aggravation, are in fact
ridiculously hard and painful.
Real debugging or some sort of cargo-cult debugging, going through the
motions and having faith that it will have the intended effect?
Real debugging. Lisp macros are a good deal less arcane than you seem
to think; the ones you write 95% of the time are really just
straightforward Lisp functions that act on a tree made up of conses.Except that macros lack the natural encapsulation barrier that
surrounds functions, as explained elsethread. With all the
consequences for debugging straightforwardness that that implies.
I don't understand this.... Would you care to explain? Debugging
macros implies debugging an AST rewriting process (something you do
not have at hand with the C preprocessor). In what way you are
"breaking the 'natural encapsulation' barrier"?
I am quite certain that Pascal is capable of speaking for himself.
This is clearly incorrect. They are still both macros, which means
that a certain intersection of their natures exists. Particularly,
those things that follow unassailably from the fundamental definition
of "macro", independently of implementation details, will lie within
that intersection, and it is those things that form the basis of my
macro-related arguments here.
I've already answered you.
Yet this is precisely what happens when you use any kind of XML-based
configuration in Java and other languages.
Any decently-sized enterprise application will use at least some
of them, and probably others. All of these files refer (using
strings!) to names of classes, or even properties and methods of those
classes, and combine them *without* any kind of static type checking,
since XML is not considered to be source code and thus not compiled.
If you say that programmers should get rid of these non-statically-
typed tools and always use statically-typed Java for everything,
that's fine
So I'm just saying that what in Spring you write as
<bean id="someObject" class="com.mypackage.MyClass">
<property name="someProperty" ref="someOtherObject" />
</bean>
in Lisp
(defvar *some-object*
(make-instance 'my-package:my-class
:some-property *some-other-object*))
and *compile* and load the file with this code *at runtime*, getting
warnings or errors if you have made mistakes.
I know JUnit and regularly use it - for testing Java code. I'm not
aware of how JUnit could test fragments of XML.
Yes, don't judge a language by its trolls - we have some of them in
comp.lang.lisp, too.
At the moment, we are in the lucky situation that Xah Lee and Jon
Harrop are taking a rest
but the Maas troll who started this thread is still active.
P.S.: I think we can also be quite sure that there are no Lisp or Java
"gods" present in this thread.
You're complaining that macros can do something that functions can do
too?
You might want to explain this "lack of encapsulation barrier" stuff
so we can tell you specifically how wrong you are this time.
The language forbids to define methods of standard generic functions
on standard classes.
Next if it's the name of the generic-function you're interested in,
you can always shadow it it and use your own symbol of same name
But at least, with Lisp you can indeed develop big software with less
developers, smaller teams than with other programming languages.
Therefore you don't.
Lisp language designers don't think lisp programmers are dumb.
Not at all.
You are not the one to say whether they'd be obsolete or not, only
their users.
And corporations may have something else to do, and something else to
finance, than to pay java programmers to follow the fashion of the day
in GUI for their mission critical software.
Appropriate software can help too - an 866 MHz P3 with 256 MB RAMSoftware development does not necessarily require much computer power.
An old 486 with DOS 6.22 and DJGPP for C programming does not seem slow.
The editor may seem a bit primitive, but then more thinking and less
typing is usually a good thing.
Unfortunately, the smartest programmer in the world cannot make a
macro that uses an argument multiple times and simultaneously avoids
all four of: multiple evaluation of that argument, variable capture,
variable hiding, and use of a global variable. In any language,
regardless of details of the macro implementation. He might as well
try to write an algorithm that answers the halting problem for any
input program. It is simply not logically possible for him to succeed.
Series Expansion said:In my browsings around the net, the free Lisp implementations I've
come across seem to all be line-oriented. While it's possible that
I've missed something, it looks like the facilities required to create
a more capable UI are unavailable outside of expensive commercial
implementations.
Series Expansion said:I'm not the one doing the flaming here at all.
I just explained why the package system won't. Adding new classes in
their own packages? No problem, the package system can distinguish
foo.String from bar.String. Adding new methods to an existing class,
say foo.String? Uh-oh. Is that baz's foo.String.doIt() or quux's
foo.String.doIt()? They have the same method name, are methods of
classes with the same name, and the classes are in the same package.
As far as the compiler is concerned, they are the same. The package
system cannot distinguish them unless we add another layer of
namespacing, this time INSIDE classes, and have foo.String.baz.doIt()
and foo.String.quux.doIt() instead of just foo.String.doIt() as the
fully-qualified names. And now we're deep in migraine-headache
territory, without oar or compass...
I'll grant that you are not flaming. You are just blathering. You are
just spouting idiotic comments about technology that you clearly do not
understand.
Seamus MacRae said:Java can do this (return an object or null), and java.util.Map.get()
does it and is in the standard library.
I V said:I'm not exactly sure when the first windowed version of Emacs was
developed, but GNU Emacs had a windowed version in 1987:
http://www.gnu.org/bulletins/bull2.txt
Emacs has been a windowed program for over 20 years.
Series Expansion said:Come off it. You're grafting on something the compiler and language
weren't originally designed for, so it's going to necessarily suck
compared to the real deal.
Oh, shit. I think you guys may actually be dealing with someone with a
9th-dan black belt in usenet-fu here. Do you see how he subtly, but
quite definitely, retaliates for your earlier insulting comparison of
his Java code to vomit by doing the same to your Lisp code here?
No matter. I'm outta here before it all hits the fan.
Now you can see where the problem will show up. If I want to add a
Complex noun, now I have to add a plus(Complex, Complex) to plus. Which
means I have to modify something in the system package. Uh-oh!
It all boils down to which programmers will be doing more often: adding
new nouns which may be used with already-existing verbs, or adding new
verbs which may be used with already-existing nouns.
Adding new nouns which are used only with new verbs is not a problem in
either case.
Right.
Adding new nouns which may be used with already-existing verbs is not a
problem if namespaces contain nouns, which contain implementations per
supported verb. But it is a problem if namespaces contain verbs, which
contain implementations per supported noun.
Adding new verbs which may be used with already-existing nouns is not a
problem if namespaces contain verbs, which contain implementations per
supported noun. But it is a problem if namespaces contain nouns, which
contain implementations per supported verb.
So, if new nouns with existing verbs is more common, Java's method is
better. If new verbs with existing nouns is more common, Lisp's method
is better. (Leaving static vs. dynamic typing entirely alone here and
considering only the order of scoping of nouns and verbs within
namespaces.) Doing the "wrong" one in either language will cause
headaches unless there's a way to namespace separately by noun and verb,
which would cause its own inherent variety of headaches instead.
My own experience tells me that new nouns with existing verbs is more
common. I quite often want to define a new Java class that has state. I
much less often wish for an existing Java class to have a method I've
never heard of before.
The workaround also isn't usually that bad: create a utility class with
a static method to do the manipulation. It can't be polymorphic or use
the object's private state directly, but the latter is for the best and
the former, while annoying, isn't usually a show-stopper.
The Lisp way around would present problems.
On the rare occasion I
wanted to augment an existing class with new behavior it would be easy:
define my own verb in my own namespace and set up somehow a polymorphic
dispatch on object type. On the much more frequent occasion I wanted to
add a new noun, I'd often be forced to change verbs that lived in
pre-existing namespaces, and maybe even in more than one namespace; the
code for my new noun would be scattered all over the codebase AND the
namespaces within the system, rather than in exactly one place in each.
Ouch.
There's also going to be big differences in polymorphism. With an object
oriented system, nouns can be subtypes of other nouns, and verb behavior
can be inherited, with or without modification. Dispatch is based on the
run-time-type of the noun, and adding a new polymorphic type is easy. In
Java, suppose there was an Addable interface specifying the plus method,
and Integer, Float, and Double implemented it. If I created my Complex
class and implemented Addable, code that did generic sums over Addables
would automatically also work with Complex now. I wouldn't have to make
any changes outside the Complex class.
With Lisp, I'd need to change the system namespace's plus verb's
dispatch table manually so that it knew about my Complex class, on the
other hand.
Both problems in one. In fact, every combination of noun and
verb in dynamic dispatch needs to be explicitly specified
somewhere. From the sounds of it, I couldn't just say "Complex is a type
of Number" in Lisp and have the compiler automatically know where to
dispatch plus, minus, times, and dividedBy;
I'd have to edit four
separate dispatch tables in four separate places, AND define (hopefully
all in one final, fifth place) my Complex implementations of these that
the new dispatch table entries would point to.
With Java I'd just have
to define the implementations, naming them correctly, and stick
"implements Number" somewhere and away I'd go.
That's the same thing isn't it? He says "private", you say "won't be
exported"; it looks the same to me.
At each place where it arises.
This can happen in Java too, if the same piece of code uses two
different classes with the same unqualified name. You can end up with
code littered with "java.util.Date" and "javax.sql.Date" for instance in
some types of enterprise code. It's god-awful. All those repeated
"java.util." and "javax.sql." prefixes add up to quite a lot of
boilerplate.
Fortunately, it's rare to get name clashes between different peoples'
nouns and still need to intersperse both in one bit of code. It's much
more common with verbs:
someIOStream.close();
aDoor.close();
aPort.close();
aSocket.close();
aTransaction.close();
if (difference(pointA, pointB).close()) doSomething();
I'd hate to have to fully qualify all my "close"s, or "open"s, or
"free"s, or "release"s, or "next"s, or "remove"s, or "equals"s, instead
of the correct one being inferred from the type of the expression to the
left of it.
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.