Account Options

  1. Anmelden
Das alte Google Groups wird demnächst nicht mehr unterstützt. Die neue Version ist jedoch nicht kompatibel mit Ihrem Browser.
Google Groups-Startseite
« Google Groups-Startseite
Nachricht von Diskussion Enumeration must DIE...

Received: by 10.59.6.226 with SMTP id cx2mr937846ved.30.1350691231477;
        Fri, 19 Oct 2012 17:00:31 -0700 (PDT)
X-BeenThere: scala-internals@googlegroups.com
Received: by 10.52.89.80 with SMTP id bm16ls2703879vdb.9.gmail; Fri, 19 Oct
 2012 17:00:30 -0700 (PDT)
Received: by 10.58.202.67 with SMTP id kg3mr1026823vec.12.1350691230298;
        Fri, 19 Oct 2012 17:00:30 -0700 (PDT)
Received: by 10.58.202.67 with SMTP id kg3mr1026821vec.12.1350691230275;
        Fri, 19 Oct 2012 17:00:30 -0700 (PDT)
Return-Path: <som.sn...@gmail.com>
Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45])
        by gmr-mx.google.com with ESMTPS id dj17si823735vdb.1.2012.10.19.17.00.30
        (version=TLSv1/SSLv3 cipher=OTHER);
        Fri, 19 Oct 2012 17:00:30 -0700 (PDT)
Received-SPF: pass (google.com: domain of som.sn...@gmail.com designates 209.85.212.45 as permitted sender) client-ip=209.85.212.45;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of som.sn...@gmail.com designates 209.85.212.45 as permitted sender) smtp.mail=som.sn...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-vb0-f45.google.com with SMTP id p1so1457660vbi.18
        for <scala-internals@googlegroups.com>; Fri, 19 Oct 2012 17:00:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type;
        bh=jMLuH0BKMMRX2+6ytB+6umVd0V8TH88q+fE6kGlrrBs=;
        b=jR+7mJWXqjgFWf7LdpiiFMKTquuXLyoQtMDJAjgGnGy/0FHN2qB8KgCyNfw+HnGWjz
         099H15AirGiVN81Z+dyPIL75Bmf4A4EdjYwIpgl3VY1YziQZae/RSjzaf5ISkObmK03+
         eCxVJcaZa2mmqiZMrgj9AhNgZqQ/uia+ZAoKC/wYSp6oLfWKJwIzHXwQ6wM8NIY9bbbf
         DK1Qx4JctLsTgrU859HovbaTyZ+xvV1JKVd46gAU+8YBCjqsMWcdIYzpP2XU4NkFAQJf
         hRUu1Rt2QzKr1mx6ExMeifzRp0KQ8cFiMiyc4+j6gTi0p+5mmSE72mAtEC+8iHTud5Kt
         GHAQ==
MIME-Version: 1.0
Received: by 10.220.225.138 with SMTP id is10mr3755620vcb.24.1350691230077;
 Fri, 19 Oct 2012 17:00:30 -0700 (PDT)
Received: by 10.220.153.139 with HTTP; Fri, 19 Oct 2012 17:00:29 -0700 (PDT)
Date: Fri, 19 Oct 2012 17:00:29 -0700
Message-ID: <CAPaMnL5eOVk5MDDPW--MTvht090f5oZavXyhzBnPxv-gH7v...@mail.gmail.com>
Subject: Enumeration must DIE...
From: Som Snytt <som.sn...@gmail.com>
To: scala-internals <scala-internals@googlegroups.com>
Content-Type: multipart/alternative; boundary=14dae9ccd476f853a704cc724eac

--14dae9ccd476f853a704cc724eac
Content-Type: text/plain; charset=ISO-8859-1

...where DIE = Divergent Implicit Expansion.

While looking at the DIE issue with mapping Enumeration values
https://issues.scala-lang.org/browse/SI-5534

I noticed that one quick fix is to make Value no longer Ordered.

My question is whether the "id" or "ordinal" for Enumeration.Values should
be internal detail.  By extension, we can remove Ordered.  I moved the
Ordering[Value] to a related companion class.

As an example, Reporter.Severity is a Value used just as an int wrapper. I
had to add Ordered back to Severity for INFO < ERROR tests.

I reread the DIE page of the spec, combed through the -Yinfer-debug, and
more/less understand what's intended by the newCBF for SortedSet.  However,
my understanding is only 66% so far on the implicit problem, so I don't
want to suggest that this is the optimal fix.

Also of interest, ValueSet uses an underlying BitSet, so you lose a bit of
range:
https://issues.scala-lang.org/browse/SI-6094
but probably ValueSet doesn't want to create sparse BitSets with huge
ranges anyway and should switch to a different representation after a
relatively small topId - bottomId.

If ids were only ordinals, with bottomId always zero, the conceptual model
would be as simple as it really is.

--14dae9ccd476f853a704cc724eac
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

...where DIE =3D Divergent Implicit Expansion.<br><br>While looking at the =
DIE issue with mapping Enumeration values<br><a href=3D"https://issues.scal=
a-lang.org/browse/SI-5534" target=3D"_blank">https://issues.scala-lang.org/=
browse/SI-5534</a><br>


<br>I noticed that one quick fix is to make Value no longer Ordered.<br><br=
>My question is whether the &quot;id&quot; or &quot;ordinal&quot; for Enume=
ration.Values should be internal detail.=A0 By extension, we can remove Ord=
ered.=A0 I moved the Ordering[Value] to a related companion class.<br>

<br>As an example, Reporter.Severity is a Value used just as an int wrapper=
. I had to add Ordered back to Severity for INFO &lt; ERROR tests.<br><br>I=
 reread the DIE page of the spec, combed through the -Yinfer-debug, and mor=
e/less understand what&#39;s intended by the newCBF for SortedSet.=A0 Howev=
er, my understanding is only 66% so far on the implicit problem, so I don&#=
39;t want to suggest that this is the optimal fix. <br>
<br>Also of interest, ValueSet uses an underlying BitSet, so you lose a bit=
 of range:<br>
<a href=3D"https://issues.scala-lang.org/browse/SI-6094" target=3D"_blank">=
https://issues.scala-lang.org/browse/SI-6094</a><br>but probably ValueSet d=
oesn&#39;t want to create sparse BitSets with huge ranges anyway and should=
 switch to a different representation after a relatively small topId - bott=
omId.<br>

<br>If ids were only ordinals, with bottomId always zero, the conceptual mo=
del would be as simple as it really is.<br><br>

--14dae9ccd476f853a704cc724eac--