Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id r69NmxJY032273 for ; Wed, 10 Jul 2013 01:49:00 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx011) with ESMTP (Nemesis) id 0MOT6D-1UrUzT068D-005qLe for ; Wed, 10 Jul 2013 01:48:54 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id r69Nk5OE028766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 10 Jul 2013 01:46:05 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r69M149P013736; Wed, 10 Jul 2013 01:46:04 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 10265534 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 10 Jul 2013 01:46:04 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r69Nk4c7019828 for ; Wed, 10 Jul 2013 01:46:04 +0200 Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r69NjtvZ027119 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Wed, 10 Jul 2013 01:45:59 +0200 Received: by mail-pd0-f170.google.com with SMTP id x11so5761493pdj.29 for ; Tue, 09 Jul 2013 16:45:55 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.68.59.98 with SMTP id y2mr28400896pbq.135.1373413555233; Tue, 09 Jul 2013 16:45:55 -0700 (PDT) Received: by 10.66.150.226 with HTTP; Tue, 9 Jul 2013 16:45:55 -0700 (PDT) References: Content-Type: text/plain; charset=windows-1252 X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id r69Nk4c7019829 Message-ID: Date: Tue, 9 Jul 2013 19:45:55 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: Named options/enumerations (Was re: Defining \bool_case:nn) To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by relay.uni-heidelberg.de id r69Nk5OE028766 Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:nEnxjlzF0S0=:CQFrDFw3hTiISpW2E30F14 Ao7D3d4JHRBZmU5YgNWURaeHBzF8GtlVSulEbZ7+I1L/vUl62Xbd/qXloAXHxESv0OKN2sP 1596fQWwBf6E9KeVjMEh/ZdFh0mzmIXNDhqwfgR2SrMwPWeegGXZsIwCyiAVhfIe88KbY66 3ObYgK1dfE8agNTY2fwf3yov2ZRfVYrWZc9QeZ//rXNc44OP+MrcY8kbOAPPHeSfkFBzadw Hx13ABm/0h1lN7oJ4B1j4q0SUBLgJzGK7A0GCyiWJV4vj9h3RIh/Y+k1OI0KLXUw3khkFoq Q1BSf+mR8kLK4TnfSUqaISspVAF4IPs8/sbraO4y8psx+90xiwf2e1Hh8sbD6vJBQvhUOfy uSTovMudc7eiRqv6h3CVPYyMbXU35s2W9iiAE7H49Lt++5g5lbdITqzt5fWamgx5dXRMViz y86cf3tzN6zDWRi9+BgnIELzpxQdooLu8Clf1w1yS7Ll0dys0/K3/PAw0dBzsTwPPWl0ftU 2O3FIsu4zHk+KEliPCTk4Dc0QLELlL3kpOJBApDJ2IXsT1exttow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P4CiM2o= X-UI-Loop:V01:/C8mDGrnBHw=:jo1zkBokF/ZC05c215UblMag1VinYEIzIGjeAvELSuQ= Status: R X-Status: X-Keywords: X-UID: 7227 Hello, >> \keys_define:nn { jcsfonts } >> { >> font .choice: , >> font / cmodern .code:n =3D { } , >> font / kpfonts .code:n =3D { \RequirePackage{kpfonts} } , >> } > > The code in the various options is more than a single line =97 about te= n > lines per option, actually, and it seems messy to intertwine option > processing with option execution like that. Ok. >> I don't really get the issue with \str_case:Vnn, to be honest, and I >> don't see the advantage of an enum type. Given that it makes the >> syntax much more verbose, I am so far not convinced. > >> An enum type seems to only be useful if it is significantly more >> efficient than a property list ("associative array"/"dictionary") with >> empty values. > > I'm not fixated on enumerations, but I don't see how a property list is= at > all the same thing. A enum object is one that can only take one of a > restricted list of values; in C it's basically a thinly-disguised integ= er, > combined with a list of integer constants. In expl3 it could be integer= s or > quarks (as in my bizarre idea above), whichever works better. (Or neith= er, > if the need for such a type is not there.) > > Could you please explain what you meant? Since we have no type checking (and no object-oriented code, really), it seems to me that an enum variable can simply be manipulated as a string (tl, since l3str is not yet in l3kernel). What do people want to do with an enum? (1) Make sure that its value is indeed in the correct list: for this one can keep track of a fixed set of allowed values, and since expl3 has no 'set' datatype, one can use a prop with empty values. (2) Make a case statement: this can either be done with \str_case, or with a prop having the same keys but non-empty values (giving the appropriate code to run). (3) ...? I am probably missing some of the use for enums, but so far I haven't seen a clear example of need. Also, since l3obj is not yet even drafted, it is difficult to say "go forth and implement that datatype", as it would be nicer/more useful if there was some proper object-oriented support in expl3 (ok, I think I'm the only one pushing for more of that in expl3). Does that explain a bit? Bruno