From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 4B8997EEB9 for ; Mon, 26 Oct 2015 14:33:58 +0100 (CET) IronPort-PHdr: 9a23:whKwPxAs8nitCWDpP3OfUyQJP3N1i/DPJgcQr6AfoPdwSP7/oMbcNUDSrc9gkEXOFd2CrakU1qyP6uu9ACQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTqkbnrsMCKKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46FpwfVdSr33dLgUSrlRDTJuczxkpZ6jiR6WRgKK4j4YU34KuhtOGQnMqh/gDbnrtS6vkud6kBaaPNH7BeQwVDOK6790EkKujiobYW1quFrLg9B92foI6CmqoAZyltKFbQ== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=leo@lpw25.net; spf=None smtp.mailfrom=leo@lpw25.net; spf=None smtp.helo=postmaster@out3-smtp.messagingengine.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of leo@lpw25.net) identity=pra; client-ip=66.111.4.27; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="leo@lpw25.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of leo@lpw25.net) identity=mailfrom; client-ip=66.111.4.27; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="leo@lpw25.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@out3-smtp.messagingengine.com) identity=helo; client-ip=66.111.4.27; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="postmaster@out3-smtp.messagingengine.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DmAABqKy5WmxsEb0JehApvrHyTLSGFfAKBLjwQAQEBAQEBAQEQAQEBAQEGCwsJIS5BEAGBWYIIAQEEQC4MDwsYDSEsGRIZEogJAxINsUKFXIg/A4RgAQEBAQEFAQEBAQEBAQEVBot1hRQXgwOBFIYODIc8iGWFHIonmg44glKBeCI0gmuELQEBAQ X-IPAS-Result: A0DmAABqKy5WmxsEb0JehApvrHyTLSGFfAKBLjwQAQEBAQEBAQEQAQEBAQEGCwsJIS5BEAGBWYIIAQEEQC4MDwsYDSEsGRIZEogJAxINsUKFXIg/A4RgAQEBAQEFAQEBAQEBAQEVBot1hRQXgwOBFIYODIc8iGWFHIonmg44glKBeCI0gmuELQEBAQ X-IronPort-AV: E=Sophos;i="5.20,201,1444687200"; d="scan'208";a="184485172" Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Oct 2015 14:33:57 +0100 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3F4312065E for ; Mon, 26 Oct 2015 09:33:56 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute6.internal (MEProxy); Mon, 26 Oct 2015 09:33:56 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=lpw25.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=3OumKrMyaK5AFIm+MV2H6u4h7p4=; b=KFg4RA LwM9y2XGSln+jzLFnif9wpoTPDCa6+GtcGGu37Xs/6hhS52dp32gXPKQTlUnm9Mw j0unRAIo43HFogEB5ULijHnGdwg4nG3mh/Y+5eK7KyRnEzfiM+4C7xtnCIo+qvro zM7DM0iZxFPM5zHHivVk12/9kPCfUzbvdCNQo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=3OumKrMyaK5AFIm +MV2H6u4h7p4=; b=QyLvCOe5mhjVnT9+lwc8GI/H0iLRSt1Px6vlafiRSjmsklw mJeMMm+OYlQKsdjWmJO5+2NQZYr+NS3sDcgTLiUx2jAtEwi5Dfjn6QU4/YcgqtHR UqEzz9wXo2LbOXarnV79DfwH6fG/JGQJeqbZzBg/WIHI8wOKL+FTTn+d9mms= Received: by web3.nyi.internal (Postfix, from userid 99) id 107BC103EA6; Mon, 26 Oct 2015 09:33:56 -0400 (EDT) Message-Id: <1445866436.896754.420384249.0777C325@webmail.messagingengine.com> X-Sasl-Enc: 1nxM+o69KoIQo9AqzZ0wDzCI6ceDgGhcMwb2gPnYwmZb 1445866436 From: Leo White To: caml-list@inria.fr MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: MessagingEngine.com Webmail Interface - ajax-25d3ec43 In-Reply-To: <562E28A4.4020009@tu-berlin.de> References: <562E28A4.4020009@tu-berlin.de> Date: Mon, 26 Oct 2015 09:33:56 -0400 Subject: Re: [Caml-list] Why is the parameter of a type declaration a coretype? It used to be a string option, but I changed it at some point. The fundemental reason is that whilst it is syntactically an optional string (optional because of "_"), semantically it is a core_type. For example: type 'a t =3D T of 'b constraint 'a =3D 'b list is essentially equivalent to (using made-up syntax): type 'b list t =3D T of 'b This manifests as the params field in the *typed* AST being the typed equivalent of core_type. It is slightly more convenient in some places if the typed and untyped ASTs agree about such things so the untyped AST uses a core type as well. Regards, Leo On Mon, 26 Oct 2015, at 09:20 AM, Christoph H=F6ger wrote: > I am writing a syntax extension for OCaml and the following puzzles me: >=20 > and type_declaration =3D > { > ptype_name: string loc; > ptype_params: (core_type * variance) list; > ^^^^^^^^^ >=20 > Why is a type-parameter a core_type and not just a string? What is the > meaning of a non-variable parameter? >=20 >=20 > --=20 > Christoph H=F6ger >=20 > Technische Universit=E4t Berlin > Fakult=E4t IV - Elektrotechnik und Informatik > =DCbersetzerbau und Programmiersprachen >=20 > Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin >=20 > Tel.: +49 (30) 314-24890 > E-Mail: christoph.hoeger@tu-berlin.de >=20 > --=20 > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs