COIN-OR::LEMON - Graph Library

Opened 15 years ago

Last modified 8 years ago

#246 new enhancement

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

Reported by: Peter Kovacs Owned by: Alpar Juttner
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 ; Changed 15 years ago by Alpar Juttner

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 ; Changed 15 years ago by Peter Kovacs

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 ; Changed 15 years ago by Alpar Juttner

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 14 years ago by Peter Kovacs

Milestone: LEMON 1.2 releaseLEMON 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 11 years ago by Peter Kovacs

Milestone: LEMON 1.3 releaseLEMON 1.4 release
Owner: changed from Peter Kovacs to Alpar Juttner

comment:6 Changed 8 years ago by Alpar Juttner

Milestone: LEMON 1.4 releaseLEMON 1.5 release
Note: See TracTickets for help on using tickets.