[Grace-core] Names for the [...] literal

Kim Bruce kbbruce47 at gmail.com
Wed Feb 3 16:00:29 PST 2016


Here's another idea (that I'm not sure is great, but worth thinking
about).  Make the minimal thing have type Seq (rather than Sequence),  My
only fear is that people would find it easier to type Seq than Sequence and
hence use it.  If not that, then "run" or "series" would work for me.

On Wed, Feb 3, 2016 at 3:13 PM Andrew P Black <black at cs.pdx.edu> wrote:

>
> On 3 Feb 2016, at 00:00 , James Noble <kjx at ecs.vuw.ac.nz> wrote:
>
> I meant to ask explicitly,  should the “[ ]”’s interface be minimal (just
> iteration and say size) or maximal (a collection).
>
>
> You *did* ask this explicitly.  I think that you have asked three times
> now ;-)
>
> For all the reasons that you quote, it should be minimal.  Didn't we agree
> on that?   I though that all that was at issue is the name.
>
> I'm for the name "run", but if you don't like that, then I would choose
> "lineup".  I find "series"  acceptable too, but likely to cause more
> confusion.  For example, one might say in class "this method takes a series
> of arguments" and have students think that it takes a variable number of
> arguments, rather than one argument that is a collection.  This is less
> likely to happen with a term like "lineup" that is less likely to be
> mistaken for everyday speech.
>
> In addition, because we do *not* want students to use these [ things ]
> for everyday programming, we should *not* choose a name that students may
> well associate with an everyday programming construct.  So an "oddball"
> name like *boundedIterable* or *conseqution* or *lineup* is actually
> preferable to something like list or sequence.
>
> With regard to your suggestion, I would rather *not* repurpose “list” to
> be immutable, since the languages to which people are likely to move from
> Grace — Java, C++ & Python — use “list” for mutable structures.  The
> standard data structures course will probably teach “linked lists”, which
> are mutable.
>
> When we chose *sequence,* *list, and set* a couple of years ago, we did
> this in the conscious knowledge that we didn't have a name for immutable
> sets.  One alternative that we considered then, which we *could*
> reconsider now, is to use *iList* and *mList* for the two kinds of list,
> and *iSet* and *mSet* for the two kinds of set.   *If* we think that we
> might want to make this change, this is a good time to do it, because
> existing code that uses, say, list.with(1, 2, 3, 5, 7) will need to be
> edited anyway.   On the whole, I think that I'm happy with sequence and
> list, but it sounds as though you may not be.
>
> Andrew
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20160204/e2f3dee2/attachment.html>


More information about the Grace-core mailing list