load module
Marc Stiegler
marcs@skyhunter.com
Fri, 9 Jun 2000 09:19:48 -0700
This list is indeed for E-users as well. Someone else will have to answer
question 1, but the answer to question 2 is this: since E is typeless, you
are correct that E cannot reliably pick out which method/constructor to call
if there are multiple methods with signatures distinguished only by
parameter types.
To create a button with the single-string-parameter constructor, use
E call(<swing:JButton>, "new(String)", ["MyButton"])
You will find this, as well as other tricks, embedded in the eChat program
at
http://www.skyhunter.com/marc.html
The eChat program has been documented with an eye to being a part of the
introductory experience for new E programmers, though your usage of
interp evalPrint(e__quasiParser valueMaker(<file:module.e> getText))
as your solution for question 1 indicates you are in some ways far beyond
the point of being a beginner :-)
--marcs
----- Original Message -----
From: Michael Neumann <neumann@s-direktnet.de>
To: <e-lang@eros-os.org>
Sent: Friday, June 09, 2000 4:32 AM
Subject: load module
> Hi!
>
> I hope this mailing-list is not only for E-language designer but also for
> E-user.
>
>
> I have two questions:
>
> 1.)
> Is there any build-in function to load another E-file like a module?
> At the moment, I use:
> interp evalPrint(e__quasiParser valueMaker(<file:module.e> getText))
> but a command like:
> include("module.e") would be much better.
>
>
> 2.)
> why I can call this:
> <swing:JFrame> new("MainWindow")
> but this results in an error:
> <swing:JButton> new("MyButton")
>
> Both Constructors in Java accept Strings.
> Or can't E disdinguish between different Java-classes, if there is more
> than one constructor with one argument.
>
>
>
>
>
> Thanks in advance
> Michael
>
>
>