unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: The dynamic stack
Date: Thu, 08 Mar 2012 00:09:01 +0100	[thread overview]
Message-ID: <87aa3sc8ky.fsf@gnu.org> (raw)
In-Reply-To: <87vcmh1nd2.fsf@pobox.com> (Andy Wingo's message of "Tue, 06 Mar 2012 21:32:57 +0100")

Hi!

Andy Wingo <wingo@pobox.com> skribis:

> On Tue 06 Mar 2012 18:20, ludo@gnu.org (Ludovic Courtès) writes:
>
>> Andy Wingo <wingo@pobox.com> skribis:
>>
>>> I have pushed a patch to master that changes the implementation of the
>>> dynamic stack
>>
>> The “dynwind stack” actually (I misread it the first time.)
>
> Yes, it did have this name before.  (More often, "the wind list".)  But
> since "dynwind" is overloaded so much (dynamic-wind operator, <dynwind>,
> scm_dynwind_*), and the dynamic stack can have other things on it like
> prompts, I thought it best to give it a new name.

Indeed, very good point.

That said, when I first saw the topic, I was expecting something about
the VM stack, which could now be grown dynamically upon stack overflow.
:-)

Now, what would be a better name?  As you say, in an ideal world,
there’d be only one stack so...

>> Could you please add comments in dynstack.c (above each function), and
>> make sure to follow GCS-style (no hanging brace, for example)?
>
> What do you mean by "no hanging brace"?

Anything reported by:

  grep -nH -e '[[:graph:]]\+[[:blank:]]*{$' *.[ch]

such as:

  typedef enum {
    SCM_DYNSTACK_TYPE_NONE = 0,
    SCM_DYNSTACK_TYPE_FRAME,
    SCM_DYNSTACK_TYPE_UNWINDER,
    SCM_DYNSTACK_TYPE_REWINDER,
    SCM_DYNSTACK_TYPE_WITH_FLUIDS,
    SCM_DYNSTACK_TYPE_PROMPT,
    SCM_DYNSTACK_TYPE_DYNWIND,
  } scm_t_dynstack_item_type;

Also, “Don't declare both a structure tag and variables or typedefs in
the same declaration” (info "(standards) Syntactic Conventions").

> What sorts of comments would you like to see?  I have been working with
> this code a lot, so perhaps some things which are obvious to me from
> names, types, assertions, etc that might not actually be obvious.  I
> don't see what I can write that isn't wholly redundant.  Perhaps you
> will let me know :-)

Comments above functions would be nice.  For instance, I can’t tell what
this does:

  scm_t_dynstack *
  scm_dynstack_capture (scm_t_dynstack *dynstack, scm_t_bits *item)

A two-line comment above mentioning DYNSTACK and ITEM would be great
(info "(standards) Comments").  (And we could use the neat
M-x semantic-ia-show-doc, which gives a Geiser feel to this dull C
world.  ;-))

And I think it wouldn’t be redundant for many/most of the functions in
that file.

Thanks,
Ludo’.



      parent reply	other threads:[~2012-03-07 23:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-03 16:25 The dynamic stack Andy Wingo
2012-03-06 17:20 ` Ludovic Courtès
2012-03-06 20:32   ` Andy Wingo
2012-03-07  6:05     ` Noah Lavine
2012-03-07  9:51       ` Andy Wingo
2012-03-07 23:09     ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aa3sc8ky.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).