-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmsg00015.html
204 lines (183 loc) · 7.3 KB
/
msg00015.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!-- MHonArc v2.3.3 -->
<!--X-Subject: Re: JDK tools -->
<!--X-From: Pat <[email protected]> -->
<!--X-Date: Sat, 1 Jan 2000 14:49:35 -0600 -->
<!--X-Message-Id: [email protected] -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: [email protected] -->
<!--X-Reference: [email protected] -->
<!--X-Reference: [email protected] -->
<!--X-Reference: [email protected] -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML//EN">
<HTML>
<HEAD>
<TITLE>Re: JDK tools</TITLE>
<LINK REV="made" HREF="mailto:[email protected]">
</HEAD>
<BODY>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->
<HR>
[<A HREF="msg00016.html">Date Prev</A>][<A HREF="msg00019.html">Date Next</A>][<A HREF="msg00016.html">Thread Prev</A>][<A HREF="msg00019.html">Thread Next</A>][<A HREF="maillist.html#00015">Date Index</A>][<A HREF="threads.html#00015">Thread Index</A>]
<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: JDK tools</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:[email protected]">[email protected]</A>, <A HREF="mailto:[email protected]">[email protected]</A></LI>
<LI><em>Subject</em>: Re: JDK tools</LI>
<LI><em>From</em>: Pat <<A HREF="mailto:[email protected]">[email protected]</A>></LI>
<LI><em>Date</em>: Sat, 1 Jan 2000 14:49:35 -0600</LI>
<LI><em>Approved</em>: [email protected]</LI>
<LI><em>In-Reply-To</em>: <<A HREF="msg00016.html">[email protected]</A>>; from Daniel Leuck on Fri, Dec 31, 1999 at 02:41:41AM -0800</LI>
<LI><em>Mail-Followup-To</em>: [email protected], [email protected]</LI>
<LI><em>References</em>: <[email protected]> <[email protected]> <<A HREF="msg00016.html">[email protected]</A>></LI>
<LI><em>Reply-To</em>: <A HREF="mailto:[email protected]">[email protected]</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Sun does System.exit at the bottom of the main method in all of their tools. I
have no idea why but its very annoying!
Pat, your compiler work isn't obsolete (although the source is now available for
the compiler so you don't have to decompile.) Sun has yet to create a reasonable
API for the compiler. I also had to copy all the source and make massive
modifications just to compile a String in memory (rather than hitting the disk).
Another super, super, super annoying "feature" is the wonderful security
restriction which prevents classes from being reloaded even when completely
dereferenced. I can't dynamically update a class definition in Lingua without
bouncing the VM. I would think security of this type should be optional
(defaulting to "on"). Suns VM also seems to hold on to classes loaded in the VM
indefinitely. This is very poor design.
BTW - I just found a new bug. Beanshell doesn't like (primitive).class (such as
int.class) which is legal under the JLS.
wait, I just thought of something else...
Yep, I suspected as much. It also doesn't like (type)[].class (such as
Object[].class) which is also legal under the JLS.
PS The new version of BeanShell kicks ass.
...but I still think you should add some scripting niceties such as foreach and
loop statements. I've already added them to Lingua and I'd be happy to add them
to BeanShell with your permission...
foreach example:
ints=new int[] {4,5,6};
foreach(i, ints) print(i);
output:
4
5
6
loop example:
loop(i,4,6) print(i);
output:
4
5
6
You should also overload arithmetic and comparison operators for classes
extending java.lang.Number. Comparison operators should also work with any class
implementing java.lang.Comparable. Again, I'll do it for you if you approve such
changes. This should have been a Java feature but time restrictions prevented
Gosling from implementing them properly (by his own admission). Time
restrictions also screwed us out of parametric polymorphism (at least for the
moment) and multiple return values. Arg! Calling methods to add two BigDecimals
really sucks.
I know you have voiced concern with deviating from the JLS during previous
conversations we've had on this subject. I have some thoughts on that subject.
A) I don't think keywords such as foreach polute the namespace. Who uses foreach
as a variable name? If anyone does I hope I don't ever meet them in a dark
alley.
B) I tried your -strict switch idea in Lingua but performance problems arose.
This could be ameliorated by creating separate code bases but at that point you
have different languages with different bugs...
Anyway, enough bathering for today. BeanShell looks great. Back to work...
Pat wrote:
> On Thu, Dec 23, 1999 at 09:04:47PM +0100, Mikael Ståldal wrote:
> > Is it possible to run the JDK tools (javac, javap, jar, etc) from
> > within Beanshell?
> >
> ...
> > I tried to this in bsh:
> >
> > BeanShell 1.0 beta - by Pat Niemeyer ([email protected])
> > bsh % args = new String[] { "HelloWorld.java" };
> > bsh % sun.tools.javac.Main.main(args);
> >
> > and it did compile HelloWorld.java fine, but then I was
> > immediatly thrown out of bsh.
>
> I have always assumed it is possible, but I hadn't tried it.
>
> I might be the case that Sun deliberately adds a System.exit() to their
> code just to prevent you from using the JDK compiler in this way... Or maybe
> it's something else.
>
> A *long* time ago I decompiled the Sun javac package and figured out how to
> use it directly (without even necessitating going to the file system).
> However I'm sure that's all been rendered obsolete.
>
> I would like to be able to make bsh commands that wrap these, so it would be
> good if we can figure out what's up.
>
> Pat
--
X U M A <engineering for e-business>
Daniel Leuck
160 Pine St., 2nd Floor
San Francisco, CA 94111
Phone: (415)777-9988
Fax: (415)777-2704
email: [email protected]
<A HREF="http://www.xuma.com">http://www.xuma.com</A>
</PRE>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<UL><LI><STRONG>Follow-Ups</STRONG>:
<UL>
<LI><STRONG><A NAME="00019" HREF="msg00019.html">Re: JDK tools</A></STRONG>
<UL><LI><EM>From:</EM> Rich Johns <[email protected]></LI></UL></LI>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00016" HREF="msg00016.html">Re: JDK tools</A></STRONG>
<UL><LI><EM>From:</EM> Daniel Leuck <[email protected]></LI></UL></LI>
<LI><STRONG><A NAME="00016" HREF="msg00016.html">Re: JDK tools</A></STRONG>
<UL><LI><EM>From:</EM> Daniel Leuck <[email protected]></LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00016.html">Re: JDK tools</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00019.html">Re: JDK tools</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00016.html">Re: JDK tools</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00019.html">Re: JDK tools</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="maillist.html#00015"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="threads.html#00015"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</BODY>
</HTML>