Changeset 4473

Show
Ignore:
Timestamp:
09/25/08 08:58:37 (4 months ago)
Author:
pmoura
Message:

Added a syntax construct for easy access to parametric object proxies represented as Prolog facts when sending a message ({Proxy}::Message). Updated the "proxies" example to illustrate this new functionality.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/compiler/logtalk.pl

    r4472 r4473  
    29422942    var(Obj), 
    29432943    throw(error(instantiation_error, Obj::Pred, Sender)). 
    2944      
     2944 
    29452945'$lgt_send_to_object'(Obj, Pred, Sender) :- 
    29462946    var(Pred), 
    29472947    throw(error(instantiation_error, Obj::Pred, Sender)). 
    2948  
    2949 '$lgt_send_to_object'({Proxy}, Pred, Sender) :- 
    2950     !, 
    2951     call(Proxy), 
    2952     '$lgt_send_to_object_nv'(Proxy, Pred, Sender). 
    29532948 
    29542949'$lgt_send_to_object'(Obj, Pred, Sender) :- 
     
    30123007    var(Pred), 
    30133008    throw(error(instantiation_error, Obj::Pred, Sender)). 
    3014  
    3015 '$lgt_send_to_object_ne'({Proxy}, Pred, Sender) :- 
    3016     !, 
    3017     call(Proxy), 
    3018     '$lgt_send_to_object_ne_nv'(Proxy, Pred, Sender). 
    30193009 
    30203010'$lgt_send_to_object_ne'(Obj, Pred, Sender) :- 
     
    78957885% convenient access to parametric object proxies 
    78967886 
    7897 '$lgt_tr_msg'(Pred, Obj, (call(Proxy), TPred), This) :- 
     7887'$lgt_tr_msg'(Pred, Obj, (catch(Proxy, error(Error, _), throw(error(Error, Obj::Pred, This))), TPred), This) :- 
    78987888    nonvar(Obj), 
    78997889    Obj = {Proxy}, 
    79007890    !, 
    7901     '$lgt_tr_msg'(Pred, Proxy, TPred, This). 
     7891    (   var(Proxy) -> 
     7892       '$lgt_tr_msg'(Pred, Proxy, TPred, This) 
     7893    ;   callable(Proxy) -> 
     7894        '$lgt_tr_msg'(Pred, Proxy, TPred, This) 
     7895    ;   throw(type_error(object_identifier, Proxy)) 
     7896    ). 
     7897 
    79027898 
    79037899 
  • trunk/RELEASE_NOTES.txt

    r4470 r4473  
    2020    Updated the "proxies" example to illustrate this new functionality. 
    2121 
    22     Corrected a bug in the Logtalk compiler that would result in failure to  
    23     restore the operator table in case of compilation error. 
    24  
    25     Removed supported for the deprecated mutex_create/1 Prolog built-in  
     22    Corrected a bug in the Logtalk compiler that would result in failure  
     23    to restore the operator table in case of compilation error. 
     24 
     25    Removed support for the deprecated mutex_create/1 Prolog built-in  
    2626    predicate. 
    2727