From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 B18727F712 for ; Sun, 2 Feb 2014 12:55:38 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of tom.j.ridge@googlemail.com) identity=pra; client-ip=209.85.192.178; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of tom.j.ridge@googlemail.com designates 209.85.192.178 as permitted sender) identity=mailfrom; client-ip=209.85.192.178; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-pd0-f178.google.com) identity=helo; client-ip=209.85.192.178; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="postmaster@mail-pd0-f178.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkkCAAwy7lLRVcCylGdsb2JhbABYhBu+WggWDgEBAQEHCwsJEiqCbAEBOBAVXRIBBQEiiAMBAxGfD4sThFIBBZMRChknDYlEBpNImC6QNBgpgWWCdDw X-IPAS-Result: AkkCAAwy7lLRVcCylGdsb2JhbABYhBu+WggWDgEBAQEHCwsJEiqCbAEBOBAVXRIBBQEiiAMBAxGfD4sThFIBBZMRChknDYlEBpNImC6QNBgpgWWCdDw X-IronPort-AV: E=Sophos;i="4.95,760,1384297200"; d="scan'208";a="56486494" Received: from mail-pd0-f178.google.com ([209.85.192.178]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 02 Feb 2014 12:55:24 +0100 Received: by mail-pd0-f178.google.com with SMTP id y13so5924054pdi.9 for ; Sun, 02 Feb 2014 03:55:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=JVg5BDz21nnIMR8F3L9a6DIZH7TC50kjVu0PAeN2chE=; b=l5ETyw6uCVunHgfjSc7/uCdcGqjYjEmXPjhZS2NHNWYkRnpb0J8m52Ju9SNnM6mh4y OYdDg+07/RtsLJTyp8MYd6Mj00XgCPkod4qUQgxyrnNIkDmhsM2I+Sq2GTvJe93Fa4BY n3gfCB0dX2cW5sUHnFt+/Yt0VM0W88i5UBn3iVSgChPyEH9MtuWTP4nRhXqxn6je6mEV 4QiMpqQjuiEWoTmuaiMtw7i2lXaB9Yy+55jY3hGjnNfEdLeSSiHu1d6pvR7LLZjk0iRn m0uBmhtLu316BXDPVDB/vm1Hur3kk3fYVU3Wxg8z4kVctokkk1Nq9W7m/4vruclBh79r roEQ== X-Received: by 10.66.163.2 with SMTP id ye2mr31052839pab.110.1391342122979; Sun, 02 Feb 2014 03:55:22 -0800 (PST) MIME-Version: 1.0 Sender: tom.j.ridge@googlemail.com Received: by 10.70.104.243 with HTTP; Sun, 2 Feb 2014 03:55:02 -0800 (PST) From: Tom Ridge Date: Sun, 2 Feb 2014 11:55:02 +0000 X-Google-Sender-Auth: uE6-b24U-T5Syqai9E8NnmIrLeM Message-ID: To: caml-list Content-Type: text/plain; charset=ISO-8859-1 Subject: [Caml-list] Question about objects and method overriding Dear caml-list, With records, one can functionally update a field e.g. as { r with some_field=new_value } And new_value may, of course, be a function. With objects, is there similar functionality? e.g. can I write something like {{ myobj with method some_method=new_method }} ? Of course, I could copy the methods from myobj explicitly into a new object (and set some_method to new_method), but I might not know all the methods available on myobj, and even if I do this becomes textually extremely verbose. Of course, new_method cannot directly refer to self etc. Basically I am using objects in a similar way to records, and would like to use this functional record update feature. Thanks Tom