[GRASS5] Raster API names suggestion

Hi again,

to improve the GRASS API name convention, I would like to
suggest to rename the raster functions from G_ to Rast_.
A recursive find/sed should easily do the job.

Markus

to improve the GRASS API name convention, I would like to
suggest to rename the raster functions from G_ to Rast_.
A recursive find/sed should easily do the job.

can you give examples of which functions would be changed?

Hamish

On Sat, Jul 03, 2004 at 05:47:50PM +1200, Hamish wrote:

> to improve the GRASS API name convention, I would like to
> suggest to rename the raster functions from G_ to Rast_.
> A recursive find/sed should easily do the job.

can you give examples of which functions would be changed?

For example:

G_put_raster_row () -> Rast_put_row ()
G_open_raster_new() -> Rast_open_new ()
G_read_raster_timestamp () -> Rast_read_timestamp ()

etc.

As far as I understand all these functions are historically
called G_something, but IMHO this should be cleaned up
to make the GRASS API more transparent to (new) programmers.

Markus

On Mon, 5 Jul 2004, Markus Neteler wrote:

On Sat, Jul 03, 2004 at 05:47:50PM +1200, Hamish wrote:
> > to improve the GRASS API name convention, I would like to
> > suggest to rename the raster functions from G_ to Rast_.
> > A recursive find/sed should easily do the job.
>
>
> can you give examples of which functions would be changed?

For example:

G_put_raster_row () -> Rast_put_row ()
G_open_raster_new() -> Rast_open_new ()
G_read_raster_timestamp () -> Rast_read_timestamp ()

And the G__* () too as Rast__* (), I think. Would it be sensible to leave
the 5.0 series as G_* (), and migrate the development series, that's what
you are suggesting, isn't it? Then modules using the old forms would trip
up, and alert the programmer to the change? Would G_* () stay for the
non-raster functions in libgis - I think so?

Roger

etc.

As far as I understand all these functions are historically
called G_something, but IMHO this should be cleaned up
to make the GRASS API more transparent to (new) programmers.

Markus

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no

On Mon, Jul 05, 2004 at 02:26:37PM +0200, Roger Bivand wrote:

On Mon, 5 Jul 2004, Markus Neteler wrote:

> On Sat, Jul 03, 2004 at 05:47:50PM +1200, Hamish wrote:
> > > to improve the GRASS API name convention, I would like to
> > > suggest to rename the raster functions from G_ to Rast_.
> > > A recursive find/sed should easily do the job.
> >
> >
> > can you give examples of which functions would be changed?
>
> For example:
>
> G_put_raster_row () -> Rast_put_row ()
> G_open_raster_new() -> Rast_open_new ()
> G_read_raster_timestamp () -> Rast_read_timestamp ()
>

And the G__* () too as Rast__* (), I think. Would it be sensible to leave
the 5.0 series as G_* (), and migrate the development series, that's what
you are suggesting, isn't it?

Right, usually I am thinking of 5.7.

Then modules using the old forms would trip
up, and alert the programmer to the change?

That sounds like a good idea.

Would G_* () stay for the non-raster functions in libgis - I think so?

Exactly. Then the idea of the G_ functions will become clear.

I don't intend to bother everybody, but we should improve the
raster API. See also next email.

Markus

If it is only for aesthetic reasons, I would ask you to
don't change anything! It will be a lot of work without
any real benefits.
It would break all existing applications using GRASS libraries,
which are not part of GRASS package, e.g. GDAL (->QGIS).

Radim

On Monday 05 July 2004 14:35, Markus Neteler wrote:

On Mon, Jul 05, 2004 at 02:26:37PM +0200, Roger Bivand wrote:
> On Mon, 5 Jul 2004, Markus Neteler wrote:
> > On Sat, Jul 03, 2004 at 05:47:50PM +1200, Hamish wrote:
> > > > to improve the GRASS API name convention, I would like to
> > > > suggest to rename the raster functions from G_ to Rast_.
> > > > A recursive find/sed should easily do the job.
> > >
> > > can you give examples of which functions would be changed?
> >
> > For example:
> >
> > G_put_raster_row () -> Rast_put_row ()
> > G_open_raster_new() -> Rast_open_new ()
> > G_read_raster_timestamp () -> Rast_read_timestamp ()
>
> And the G__* () too as Rast__* (), I think. Would it be sensible to leave
> the 5.0 series as G_* (), and migrate the development series, that's what
> you are suggesting, isn't it?

Right, usually I am thinking of 5.7.

> Then modules using the old forms would trip
> up, and alert the programmer to the change?

That sounds like a good idea.

> Would G_* () stay for the non-raster functions in libgis - I think so?

Exactly. Then the idea of the G_ functions will become clear.

I don't intend to bother everybody, but we should improve the
raster API. See also next email.

Markus

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5