[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: marrying braket for ?: operator
From: |
Robert Marshall |
Subject: |
Re: marrying braket for ?: operator |
Date: |
Thu, 28 Jul 2005 21:06:20 +0100 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) |
On Thu, 28 Jul 2005, Alan Mackenzie wrote:
> Baloff <washdc@wash.edu> wrote on 28 Jul 2005 15:20:51 +1000:
>> Hello
>
>> when I move my pointer to a braket, it highlight its marrying
>> braket. but how can I get it to do the same with the ternary
>> if-else operator (?:) I hope this is a good group for this question
>> otherwise please point me.
>
> It's exactly the right group!
>
> There is no command which jumps from a ? to it's : or vice versa.
> Maybe there should be one. Maybe somebody, somewhere, has
> implemented one, and will jump in here with a URL pointing to the
> source code.
>
> The thing is, though, how useful would this command be? Programmers
> tend not to nest these conditional expressions very much. The
> command would have to bound to a key sequence, something like C-c :
> (that's "control-c colon"). By the time you've typed that in, you
> could just as well have found the colon by interactive search by
> typing C-s :.
>
And it's probably not straightforward (for either case), you might have
(x > 4) ? weeble::kerplunk(funky::gibbon ? whoop : holler()) :
foible::gibber::eugh();
Robert
--
La grenouille songe..dans son château d'eau