guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recursive namespace


From: Alex Shinn
Subject: Re: Recursive namespace
Date: 24 Apr 2001 11:21:15 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.100

>>>>> "Yutaka" == NIIBE Yutaka <address@hidden> writes:

    Yutaka> If we'd implement
    Yutaka> the idea above correctly, it may result: Module can be
    Yutaka> determined at run-time dynamically.  Say,

    Yutaka>     (let ((module (procedure-which-determine-module)))
    Yutaka> (module::func blah blah blah))

    Yutaka> See?  I don't think it is good idea.  Module should be
    Yutaka> determined at comile time.  Please think again.  There is
    Yutaka> no need to use module at run time dynamically.

I can think of plenty of reasons you'd want to determine modules
dynamically at run time.  Consider a general database interface, like
Perl's DBI, which can choose between different database backends
depending on what you have installed.  Or modules which check if you
have certain features/libraries installed and take advantage of those,
substituting stub definitions otherwise.  One idea I've been kicking
around (much more complicated than the database example), is a
universal graphical interface module, which would try to present the
same data through either GTK, ncurses, or whatever native interface
you have.

Of course, this makes compiler optimizations much more difficult.  But
would it be too much to allow run-time lookup of modules, and only
optimize on what's known at compile time?  Maybe in the future
figuring out a way to optimize a "module chooser" with pre-defined
symbol names.

-- 
Alex Shinn <address@hidden>
Lisper, Smalltalker, and all around poor speaker



reply via email to

[Prev in Thread] Current Thread [Next in Thread]