Ticket #14 (closed enhancement: wontfix)

Opened 4 months ago

Last modified 4 months ago

":" operator and extended categories

Reported by: victor Owned by: pmoura
Priority: minor Milestone: Logtalk enhancements
Component: compiler Version: 2.31.4
Keywords: Cc:

Description

Hello,

I am wondering if it is normal that the operator ":" is working for imported categories (in object) but not in categories extending categories declaring the predicate called with ":".

A little example :

:- category(one).
  pred.
:- end_category.

:- category(two, extends(one)).
  mypred :- :pred.
:- end_category.

The error I get is :

ERROR!    existence_error(procedure, pred)
          in clause: mypred:- :pred
          above line: 7

Maybe there is a good explanation, but I don't see why it shouldn't be a good idea.

Attachments

Change History

  Changed 4 months ago by pmoura

  • status changed from new to assigned
  • owner set to pmoura
  • milestone set to Logtalk enhancements

No problem in extending the functionality of the :/1 operator so that it can be used from within categories. The changes are trivial; I just need to perform some more tests before committing them.

  Changed 4 months ago by pmoura

  • status changed from assigned to closed
  • resolution set to fixed

The extending functionality is now available starting with r4270. Please check your code with this new version if possible. Reopen this ticket if you found any regression when using the :/1 control construct.

  Changed 4 months ago by pmoura

  • status changed from closed to reopened
  • resolution deleted

  Changed 4 months ago by pmoura

  • status changed from reopened to closed
  • resolution set to wontfix

I've reverted the changes in r4270, removing the extended functionality that would have allowed the use of :/1 control construct from within categories that extend other categories. Despite the simplicity of the changes, this extended functionality would mess with the simple semantics of categories, which are based in a simple importing mechanism instead of an inheritance mechanism. Note that it is always possible to use the alias/3 predicate directive to call a predicate in an extended category that is overridden in the category containing the call.

follow-up: ↓ 6   Changed 4 months ago by victor

I am not sure to understand because I was not using ":" operator to call an overridden predicate, but to call a predicate from an extended category efficiently.

If I use the "::" operator to call a predicate declared in an extended category from another category, I have the feeling that it will look for it in all the inheritance tree of objects importing the category, and it will result in an inefficient call to the predicate (since I am sure that it is only declared in the category extended)

Am I wrong ? Is there another way to make this call efficiently ?

Sorry if it is the wrong place to ask :)

in reply to: ↑ 5   Changed 4 months ago by pmoura

Replying to victor:

Sorry if it is the wrong place to ask :)

Could you post your question on the discussion forums instead? Thanks.

Add/Change #14 (":" operator and extended categories)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.