COIN-OR::LEMON - Graph Library

Opened 9 years ago

Last modified 15 months ago

#246 new enhancement

s() and t() as an alias for source() and target()

Reported by: kpeter Owned by: alpar
Priority: major Milestone: LEMON 1.5 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description

As we have u() and v() for undirected graphs, it seems to be a good idea to have shorter alias names for source() and target(), e.g. s() and t(), since they are among the most frequently used functions.

What do you think about it?

Change History (6)

comment:1 in reply to: ↑ description ; follow-up: Changed 9 years ago by alpar

Replying to kpeter:

What do you think about it?

I'm definitely in favor of it, but I'm also sure that not everybody shares this opinion.

I would also be very happy to be able to write

for(NodeIt n(g);n;++n)

instead of

for(NodeIt n(g);n!=INVALID;++n)

This line probably appears even more frequently than source(),
but I noticed high resistance when I proposed it.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 9 years ago by kpeter

Replying to alpar:

I'm definitely in favor of it, but I'm also sure that not everybody shares this opinion.

That's why it is good to have this ticket. :) Everyone can write his/her comments here. However if nobody protests against it, we could introduce these names. As an alias, of course, since we can't break the API of release 1.0.

I would also be very happy to be able to write

for(NodeIt n(g);n;++n)

instead of

for(NodeIt n(g);n!=INVALID;++n)

I have never undertood why don't we support this form. I thought about implmenetation difficulties.

This line probably appears even more frequently than source(),
but I noticed high resistance when I proposed it.

What were the reasons of who didn't like it? Could you remember? Are those reasons still relevant, even if the proposed syntax would be just an alternative?

comment:3 in reply to: ↑ 2 ; follow-up: Changed 9 years ago by alpar

Replying to kpeter:

What were the reasons of who didn't like it? Could you remember? Are those reasons still relevant, even if the proposed syntax would be just an alternative?

The argument against it was rather emotional than technical, and IMHO it has never been relevant.

comment:4 in reply to: ↑ 3 Changed 8 years ago by kpeter

  • Milestone changed from LEMON 1.2 release to LEMON 1.3 release

Replying to alpar:

The argument against it was rather emotional than technical, and IMHO it has never been relevant.

I created a separate ticket about it, so we could argue this question again. :) See #325.

In this ticket, let's consider the original question.

comment:5 Changed 5 years ago by kpeter

  • Milestone changed from LEMON 1.3 release to LEMON 1.4 release
  • Owner changed from kpeter to alpar

comment:6 Changed 15 months ago by alpar

  • Milestone changed from LEMON 1.4 release to LEMON 1.5 release
Note: See TracTickets for help on using tickets.