Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HLL's, PMCs...

4 views
Skip to first unread message

Will Coleda

unread,
May 14, 2006, 4:17:31 PM5/14/06
to Perl6 Internals
Is it possible to load a languages PMCs and create the .PMCtype
constants without using the .HLL pragma?

.HLL mucks with namespaces, which I don't want to (am not prepared
to) deal with at the moment in APL. I do, however, want to
dynamically load a library containing a PMC for APL to use.

Here's the best I can do without .HLL:

.sub main
$P1 = loadlib 'tcl_group'
unless $P1 goto urk
$I1 = find_type 'TclList'
$P1 = new $I1
$S1 = typeof $P1
say $S1
end
urk:
say "failure to load lib"
.end

(Yes, I said APL earlier, but I haven't committed any of the APL PMCs
at the time of this msg)

Basically, I'd like it if there was something as sugary as .HLL that
didn't have all the namespace side effects.


Patrick R. Michaud

unread,
May 14, 2006, 9:41:09 PM5/14/06
to Will Coleda, Perl6 Internals
On Sun, May 14, 2006 at 04:17:31PM -0400, Will Coleda wrote:
> Is it possible to load a languages PMCs and create the .PMCtype
> constants without using the .HLL pragma?

Try :immediate.

.sub _immediate :immediate
$P1 = loadlib 'tcl_group'
.end

.sub main :main
$P1 = new .TclList
...
.end

Depending on how it's being used, it may also be necessary
to have the loadlib performed as part of a :load sub
(e.g., to have the library loaded when a .pbc is loaded via
load_bytecode).

Pm

0 new messages