Re: Pike 8.0 RC1

Chris Angelico <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <CAPTjJmoV4F2bemB-myHkHHSTxryvdNhy9iaGkLk4Q9v-i12GTg@mail.gmail.com>
On Tue, Oct 28, 2014 at 7:18 PM, Stephen R. van den Berg <[email protected]> wrote:
> Zenothing wrote:
>>o Added new syntax for literal-string constants
>
>>  #{, #( and #[ starts a literal string, and it is ended by the corresponding
>>  end marker: #}, #) and #] respectively.
>
> I agree that it's a pity that this way you only have three fixed ones.
> SQL solved this differently.
>
> I'd indeed suggest that the SQL way is more elegant.  It would amount
> to something like the following Pike equivalent:
>
> #{ is terminated by #}
> #abc{ is terminated by #abc}
>
> etc.  All other rules stay the same.  It will support unlimited nesting.
> Supporting #( and #[ as well is in a similar manner of course is possible.

Presumably anything that's actually a preprocessor command would be
illegal for that - it'd be awkward if you go #string{    #string}.

The question is, do we actually need more than three? Is the
flexibility all that useful?

>>o Added the '?:' operator for compatibility with other C-like languages. It
>>is identical to '||' in pike.
>
> I guess a?:b is shorthand for a?a:b.  I'm curious though, which languages
> already have it?  I tried to google for it, but that turnes out to be
> difficult.

Yes, it is. It's a GCC extension:

http://scottmoonen.com/2008/05/27/gcc-binary-conditional/

Googled that as "binary question colon", not one of the most common
search terms I am sure!

ChrisA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.