guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A minor name improvement suggestion to Guile API


From: Yi DAI
Subject: Re: A minor name improvement suggestion to Guile API
Date: Sat, 19 Dec 2009 10:51:03 +0800



On Fri, Dec 18, 2009 at 2:44 AM, parawaiter <address@hidden> 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
(代 毅)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]