Subject: user-defined autoload within call

From: Paul Singleton <[email-masked]>
Date: Mon, 28 Feb 2000 20:42:41 +0000

I've tried to override the 3.3.0 autoloader with my own, thus:

  :- initialization set_feature(autoload, false).

  exception(undefined_predicate, N/A, Action) :-
      (   write( '[autoloading '), write( N/A), write( '...]'), nl,
          l( N)
      ->  Action = retry
      ;   write( '[autoload FAILED: '), write( N/A), write( ']'), nl,
          Action = fail
      ).

but although this works with top-level goals:

  ?- fred.
  [autoloading fred/0...]

it doesn't get used for undefined predicates within "called" goals:

  ?- Goal = fred,
  |    call(Goal).
  ERROR: Undefined procedure: fred/0

whereas the default autoloader does.  Is there an easy fix for this?
(I've not yet delved into boot/autoload.pl but I'm prepared to).

Paul Singleton