unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* A minor name improvement suggestion to Guile API
@ 2009-12-16 13:14 Yi DAI
  2009-12-17 10:46 ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Yi DAI @ 2009-12-16 13:14 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]

Hi, all, I read the following in "5.1 Overview of the Guile API" of the
reference manual.

   - Replace <= (less than or equal) with _leq.
   - Replace >= (greater than or equal) with _geq.
   - Replace < (less than) with _less.
   - Replace > (greater than) with _gr.

I'd like to suggest the following name convention which complies to names
commonly found in assembly languages.


   - Replace < (less than) with *_lt*.
   - Replace > (greater than) with *_gt*.


Should I send this to the devel-mailing list?






-- 
DAI Yi
(代 毅)

[-- Attachment #2: Type: text/html, Size: 946 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: A minor name improvement suggestion to Guile API
  2009-12-16 13:14 A minor name improvement suggestion to Guile API Yi DAI
@ 2009-12-17 10:46 ` Ludovic Courtès
  2009-12-17 14:26   ` Linas Vepstas
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2009-12-17 10:46 UTC (permalink / raw)
  To: guile-user

Hi,

Yi DAI <plm.day@gmail.com> writes:

> I'd like to suggest the following name convention which complies to names
> commonly found in assembly languages.
>
>
>    - Replace < (less than) with *_lt*.
>    - Replace > (greater than) with *_gt*.

Changing conventions would mean changing the API or maintaining function
name aliases, and I don’t think it’s worth it.

Thanks,
Ludo’.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: A minor name improvement suggestion to Guile API
  2009-12-17 10:46 ` Ludovic Courtès
@ 2009-12-17 14:26   ` Linas Vepstas
  2009-12-17 15:00     ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Linas Vepstas @ 2009-12-17 14:26 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-user

2009/12/17 Ludovic Courtès <ludo@gnu.org>:
> Hi,
>
> Yi DAI <plm.day@gmail.com> writes:
>
>> I'd like to suggest the following name convention which complies to names
>> commonly found in assembly languages.
>>
>>
>>    - Replace < (less than) with *_lt*.
>>    - Replace > (greater than) with *_gt*.
>
> Changing conventions would mean changing the API or maintaining function
> name aliases, and I don’t think it’s worth it.

well, the API is controlled by the scheme steering committee, and
a change would affect dozens of scheme implementations,
not just guile!  So this is an odd request.   And any novice
scheme programmer can create brand-new predicates of
any sort they wish, with any name desired, so I don't understand
this request at all.

--linas




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: A minor name improvement suggestion to Guile API
  2009-12-17 14:26   ` Linas Vepstas
@ 2009-12-17 15:00     ` Ludovic Courtès
  2009-12-17 19:05       ` Keith Wright
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2009-12-17 15:00 UTC (permalink / raw)
  To: linasvepstas; +Cc: guile-user

Hi,

Linas Vepstas <linasvepstas@gmail.com> writes:

> 2009/12/17 Ludovic Courtès <ludo@gnu.org>:
>> Hi,
>>
>> Yi DAI <plm.day@gmail.com> writes:
>>
>>> I'd like to suggest the following name convention which complies to names
>>> commonly found in assembly languages.
>>>
>>>
>>>    - Replace < (less than) with *_lt*.
>>>    - Replace > (greater than) with *_gt*.
>>
>> Changing conventions would mean changing the API or maintaining function
>> name aliases, and I don’t think it’s worth it.
>
> well, the API is controlled by the scheme steering committee,

AIUI he’s talking about the Scheme-to-C API mapping, which is not
controlled by “the committee”.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: A minor name improvement suggestion to Guile API
  2009-12-17 19:05       ` Keith Wright
@ 2009-12-17 18:44         ` parawaiter
  2009-12-19  2:51           ` Yi DAI
  0 siblings, 1 reply; 8+ messages in thread
From: parawaiter @ 2009-12-17 18:44 UTC (permalink / raw)
  To: Keith Wright; +Cc: ludo, guile-user

On Dec 17, 2009, at 20:05 , Keith Wright wrote:
> Currently, the variables that Scheme programmers know as
> |<| and |>|, are called in C _less and _gr.

This probably also applies to things like string<? -> string_lt() (string_lt_p ?)

> Propose to rename the C variables so that |<| and |>|
> are called in C *_lt* and and *_gt*, respectively.
> 
> I'm not sure whether the asterisks are meant to
> be part of the name.

I think that is an artifact of a multipart mime font-change.

>  This seems good to me; what
> was the programmer thinking that made it seem
> good to have asymmetric identifers for
> |<| and |>|?  The names .LT. and .GT. go back
> to the Fortran of the late fifties.

I don't see how _less and _gr was introduced with any consideration either, except just having to have a name as they were implemented.

> Whether it is worth the trouble to change,
> I don't know.

That's the question, and I'll leave that to you guys. lt, gt, are universally known. Even /bin/sh 'test' uses this. And as far as scheme implementations go, I've probably found mine (for my kind of C-integrated usage) in chibi-scheme, so disregard my opinion as anything but an outsider. I'm just saying that I think the original poster has a point and his suggestion is what I would expect to find when searching for the C-equivalents of the given scheme predicates...

Best regards,

  Lars J



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: A minor name improvement suggestion to Guile API
  2009-12-17 15:00     ` Ludovic Courtès
@ 2009-12-17 19:05       ` Keith Wright
  2009-12-17 18:44         ` parawaiter
  0 siblings, 1 reply; 8+ messages in thread
From: Keith Wright @ 2009-12-17 19:05 UTC (permalink / raw)
  To: ludo; +Cc: guile-user

> From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=)
> Cc: guile-user@gnu.org
> >>
> >> Yi DAI <plm.day@gmail.com> writes:
> >>
> >>> I'd like to suggest the following name convention
> >>> which complies to names commonly found in
> >>> assembly languages.
> >>>
> >>>
> >>>    - Replace < (less than) with *_lt*.
> >>>    - Replace > (greater than) with *_gt*.
> >>
> > well, the API is controlled by the scheme steering committee,
> 
> AIUI he's talking about the Scheme-to-C API mapping, which is not
> controlled by "the committee".

Furthermore, I think the proposal has been over truncated.

Original:

> From: Yi DAI <plm.day@gmail.com>

> reference manual:
> 
>    - Replace < (less than) with _less.
>    - Replace > (greater than) with _gr.
> 
> I'd like to suggest the following name convention

So as I understand, the proposal is:

Currently, the variables that Scheme programmers know as
|<| and |>|, are called in C _less and _gr.

Propose to rename the C variables so that |<| and |>|
are called in C *_lt* and and *_gt*, respectively.

I'm not sure whether the asterisks are meant to
be part of the name.  This seems good to me; what
was the programmer thinking that made it seem
good to have asymmetric identifers for
|<| and |>|?  The names .LT. and .GT. go back
to the Fortran of the late fifties.

Whether it is worth the trouble to change,
I don't know, but if I were planning to use
this more than once or twice, I would rename
it myself in my own code.

   -- Keith




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: A minor name improvement suggestion to Guile API
  2009-12-17 18:44         ` parawaiter
@ 2009-12-19  2:51           ` Yi DAI
  2009-12-19 18:10             ` Linas Vepstas
  0 siblings, 1 reply; 8+ messages in thread
From: Yi DAI @ 2009-12-19  2:51 UTC (permalink / raw)
  To: parawaiter; +Cc: guile-user, ludo

[-- Attachment #1: Type: text/plain, Size: 2833 bytes --]

On Fri, Dec 18, 2009 at 2:44 AM, parawaiter <parawaiter@gmail.com> wrote:

> On Dec 17, 2009, at 20:05 , Keith Wright wrote:
> > Currently, the variables that Scheme programmers know as
> > |<| and |>|, are called in C _less and _gr.
>
> This probably also applies to things like string<? -> string_lt()
> (string_lt_p ?)
>

Yes, the `_less' and `_gr' convention is universal in the Scheme-to-C API
according to the manual


>
> > Propose to rename the C variables so that |<| and |>|
> > are called in C *_lt* and and *_gt*, respectively.
> >
> > I'm not sure whether the asterisks are meant to
> > be part of the name.
>
> I think that is an artifact of a multipart mime font-change.
>

Right, that's done by Gmail. The original was in bold.


>
> >  This seems good to me; what
> > was the programmer thinking that made it seem
> > good to have asymmetric identifers for
> > |<| and |>|?  The names .LT. and .GT. go back
> > to the Fortran of the late fifties.
>
> I don't see how _less and _gr was introduced with any consideration either,
> except just having to have a name as they were implemented.
>
> > Whether it is worth the trouble to change,
> > I don't know.
>
> That's the question, and I'll leave that to you guys. lt, gt, are
> universally known. Even /bin/sh 'test' uses this. And as far as scheme
> implementations go, I've probably found mine (for my kind of C-integrated
> usage) in chibi-scheme, so disregard my opinion as anything but an outsider.
> I'm just saying that I think the original poster has a point and his
> suggestion is what I would expect to find when searching for the
> C-equivalents of the given scheme predicates...
>
>
Perhaps a little statement about my reason to suggest this seeming minor
(maybe not, according to Linas Vepstas) change. There are several Scheme
implementations that provides a Scheme-to-C API, as far as I know, like
Gambit-C, Chicken, PLT Scheme, (so does Bigloo?). I did not look into detail
of their API, solely look through their name conventions (maybe this is not
a good practice, but I don't think there's too much difference between these
APIs, so the name convention does matter in a sense). I cannot say they did
wrong, but not that beautiful really. And I finally came to Guile after
being told by some others that it has the most beautiful API. I surprising
found it was true, except these two names (`_less' and `_gr'), it's far less
beautiful than `_lt' and `_gt', note that we do have `_leq' and `_geq' (I'd
like further suggest change them to `_le' and `_ge') with symmetry. I admit
I am a perfectionist. So this proposal may not worth it. Guile's API is
beautiful, but if the mentioned four names (may affect others) are fixed, it
would be perfect.

Thanks.


-- 
DAI Yi
(代 毅)

[-- Attachment #2: Type: text/html, Size: 3716 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: A minor name improvement suggestion to Guile API
  2009-12-19  2:51           ` Yi DAI
@ 2009-12-19 18:10             ` Linas Vepstas
  0 siblings, 0 replies; 8+ messages in thread
From: Linas Vepstas @ 2009-12-19 18:10 UTC (permalink / raw)
  To: Yi DAI; +Cc: guile-user, ludo

2009/12/18 Yi DAI <plm.day@gmail.com>:


> (maybe not, according to Linas Vepstas)

Sorry, I had misunderstood the nature of your email. Please
disregard my earlier comments.

-linas




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-12-19 18:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-16 13:14 A minor name improvement suggestion to Guile API Yi DAI
2009-12-17 10:46 ` Ludovic Courtès
2009-12-17 14:26   ` Linas Vepstas
2009-12-17 15:00     ` Ludovic Courtès
2009-12-17 19:05       ` Keith Wright
2009-12-17 18:44         ` parawaiter
2009-12-19  2:51           ` Yi DAI
2009-12-19 18:10             ` Linas Vepstas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).