Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Generalizing -> & ->>

X-BeenThere: clojure@googlegroups.com
Received: by 10.90.8.32 with SMTP id 32ls3437035agh.1.p; Thu, 12 Nov 2009 
	21:59:42 -0800 (PST)
Received: by 10.91.72.12 with SMTP id z12mr4728831agk.1.1258091982496;
        Thu, 12 Nov 2009 21:59:42 -0800 (PST)
Received: by 10.91.72.12 with SMTP id z12mr4728830agk.1.1258091982468;
        Thu, 12 Nov 2009 21:59:42 -0800 (PST)
Return-Path: <wmacgy...@gmail.com>
Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198])
        by gmr-mx.google.com with ESMTP id 19si329704ywh.2.2009.11.12.21.59.41;
        Thu, 12 Nov 2009 21:59:41 -0800 (PST)
Received-SPF: pass (google.com: domain of wmacgy...@gmail.com designates 209.85.210.198 as permitted sender) client-ip=209.85.210.198;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wmacgy...@gmail.com designates 209.85.210.198 as permitted sender) smtp.mail=wmacgy...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by yxe36 with SMTP id 36so3151484yxe.11
        for <clojure@googlegroups.com>; Thu, 12 Nov 2009 21:59:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:received:in-reply-to:references
         :date:message-id:subject:from:to:content-type
         :content-transfer-encoding;
        bh=x3LblgeZMtEMWpG2CG0Ayo7MYoRfeUiqR8iP89TBpU8=;
        b=aezcA9Zuo+1pC8Rj4optHkww41ZCkVjtuukgiN3yMFZLomDGHEPtFulIP/8XHPau25
         WDBc5aNcjhJxbNVcRNoA7monp0Lotus6257TrMxLLz2/3pUXlwCSFQOB9GWajiedgx7r
         kKMecMgiDuonvX8gbvQrwuV1l/x6WjdSSzku0=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:content-transfer-encoding;
        b=XfEzl0hxY1zCBIogcAcWB1k5vPA3L4cQgipNIUpv6OLqbUdddLtnzP0ZLnXhNN1DkV
         yquMGtHqOnuTWV9Q8BIC+Vfgksv0O+8LksFtgdQEfDmH2pTPWuChOlZwYWrdmq7kT+ji
         6K/KxrAVUiH5sScoJ+2pF/jf+/X5oLK7i+qsc=
MIME-Version: 1.0
Received: by 10.150.113.19 with SMTP id l19mr6983511ybc.239.1258091979604; 
	Thu, 12 Nov 2009 21:59:39 -0800 (PST)
In-Reply-To: <b63ab4e60911121503v36fffb52ref5bc15baab1a...@mail.gmail.com>
References: <69da3db3-1fea-453d-89e3-0b90ccf0c...@u16g2000pru.googlegroups.com>
	 <f4b9e861-d093-4e6d-ab9a-09c2dad07...@s31g2000yqs.googlegroups.com>
	 <edb414440910310637k42530ba3mf5bc6fac212cd...@mail.gmail.com>
	 <1b1fa458-c50b-40e6-a5a5-86c497811...@a31g2000yqn.googlegroups.com>
	 <4AEF8AB7.7070...@meshy.org>
	 <b63ab4e60911121503v36fffb52ref5bc15baab1a...@mail.gmail.com>
Date: Fri, 13 Nov 2009 00:59:39 -0500
Message-ID: <1bc35aa0911122159j4c376e05r87b528e68ef03...@mail.gmail.com>
Subject: Re: Generalizing -> & ->>
From: Wilson MacGyver <wmacgy...@gmail.com>
To: clojure@googlegroups.com
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Yes, it's groovy, and it's "?." It's called safe navigation operator

http://groovy.codehaus.org/Operators#Operators-SafeNavigationOperator%28%3F=
.%29

On Thu, Nov 12, 2009 at 6:03 PM, Laurent PETIT <laurent.pe...@gmail.com> wr=
ote:
> 2009/11/3 Alex Osborne <a...@meshy.org>:
>>
>> Sean Devlin wrote:
>>> This is slightly unrealted, but how does one pronounce ->, ->> and the
>>> like? =A0Is this documented?
>>
>> The doc-strings usually give you a nice hint. =A0I usually use "thread"
>> for -> and "thread last" for ->>. =A0The actual symbols I think of as
>> "arrow" and "double arrow".
>>
>> Then -?> in contrib is "short-circuiting thread". =A0Not sure about the
>> symbol, perhaps "questionable arrow"? ;-)
>
> The question mark ? is there to "mimic" (somewhat) what one can find
> in OO languages such as groovy (I think it's groovy, is it ?) :
>
> someObject.?propA.?prop2
>
> where .? will check if the object is null before trying to get a
> property (or method) on it. If null : returns null, if not null,
> returns the property etc.
>
> Initially i wanted to name it ->? but the final ? is by convention
> reserved for predicates, so Rich suggested -?> (and also .?. for the
> .. equivalent).
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with y=
our first post.
> To unsubscribe from this group, send email to
> clojure+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=3Den



--=20
Omnem crede diem tibi diluxisse supremum.