On Oct 16, 12:05 am, Steven D'Aprano wrote:
> On Sat, 15 Oct 2011 15:04:24 -0700, DevPlayer wrote:
> > I thought "x not in y" was later added as syntax sugar for "not x in y"
> > meaning they used the same set of tokens. (Too lazy to check the actual
> > tokens)
Stated in response to OP wanting a
On Sat, 15 Oct 2011 15:04:24 -0700, DevPlayer wrote:
> 1. I thought "x not in y" was later added as syntax sugar for "not x in
> y"
> meaning they used the same set of tokens. (Too lazy to check the actual
> tokens)
Whether the compiler has a special token for "not in" is irrelevant.
Perhaps it
On Oct 8, 8:41 am, Alain Ketterlin
wrote:
> candide writes:
> > Python provides
>
> > -- the not operator, meaning logical negation
> > -- the in operator, meaning membership
>
> > On the other hand, Python provides the not in operator meaning
> > non-membership. However, it seems we can
On 10.10.2011 19:29, Nobody wrote:
On Sun, 09 Oct 2011 02:25:27 +0200, Alexander Kapps wrote:
Even if it's off-topic, could you add some similar explanations for
Church numerals (maybe Lambda calculus it isn't too much?)
The Church numeral for N is a function of two arguments which applies it
Chris Angelico writes:
> On Sun, Oct 9, 2011 at 12:07 AM, Jussi Piitulainen wrote:
> > But both negations can be avoided by modus tollens.
> >
> > "If you are able to start the car, the key is in the ignition."
>
> But this translation implies looking at the result and ascertaining
> the state, wh
As you see, this way of writing constants gives you much more poetic
freedom than in other programming languages.
On Tue, Oct 11, 2011 at 7:46 PM, Chris Angelico wrote:
> On Tue, Oct 11, 2011 at 7:28 PM, Nobody wrote:
>> It's useful insofar as it allows you to define "numbers" given nothing
>> o
On Tue, Oct 11, 2011 at 7:28 PM, Nobody wrote:
> It's useful insofar as it allows you to define "numbers" given nothing
> other than abstraction and application, which are the only operations
> available in the lambda calculus.
>
Heh. This is why mathematicians ALWAYS make use of previously-defin
On Tue, 11 Oct 2011 04:33:43 +1100, Chris Angelico wrote:
>> The Church numeral for N is a function of two arguments which applies its
>> first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).
>>
>
> Thanks - nice clear explanation. Appreciated. For an encore, can you
> give an
Tim Roberts wrote:
> Westley Martínez wrote:
>>On Sat, Oct 08, 2011 at 12:34:42PM -0400, Roy Smith wrote:
>>>
>>> Here's my take on parenthesis: If you need to look up whether they're
>>> necessary or not, they are :-)
>>
>>So we don't need precedence charts in the bathroom?
>
> Yes, we do, be
Westley Martínez wrote:
>On Sat, Oct 08, 2011 at 12:34:42PM -0400, Roy Smith wrote:
>>
>> Here's my take on parenthesis: If you need to look up whether they're
>> necessary or not, they are :-)
>
>So we don't need precedence charts in the bathroom?
Yes, we do, because I'm always reading code f
On 10/10/2011 1:55 PM, Ian Kelly wrote:
On Mon, Oct 10, 2011 at 11:33 AM, Chris Angelico wrote:
On Tue, Oct 11, 2011 at 4:29 AM, Nobody wrote:
The Church numeral for N is a function of two arguments which applies its
first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).
On Mon, Oct 10, 2011 at 11:33 AM, Chris Angelico wrote:
> On Tue, Oct 11, 2011 at 4:29 AM, Nobody wrote:
>>
>> The Church numeral for N is a function of two arguments which applies its
>> first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).
>>
>
> Thanks - nice clear explanat
On Tue, Oct 11, 2011 at 4:29 AM, Nobody wrote:
>
> The Church numeral for N is a function of two arguments which applies its
> first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).
>
Thanks - nice clear explanation. Appreciated. For an encore, can you
give an example of where
On Sun, 09 Oct 2011 02:25:27 +0200, Alexander Kapps wrote:
> Even if it's off-topic, could you add some similar explanations for
> Church numerals (maybe Lambda calculus it isn't too much?)
The Church numeral for N is a function of two arguments which applies its
first argument N times to its se
Le 10/10/2011 10:06, John Ladasky a écrit :
Who like that second one speaks?
Yoda his name is. Programs in Forth he must.
;)
We can add to the list :
-- Tarzan
-- Geronimo
-- don Alexandro de la Vega dying in the arms of Zorro
...
--
http://mail.python.org/mailman/listinfo/python-list
Unfortunately I don't know lambda [or for that matter, regular] calculus...
On Tue, Oct 11, 2011 at 12:01 AM, Alain Ketterlin
wrote:
> Alec Taylor writes:
>
>> On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
>> wrote:
>
>>> def true(x, y):
>>> return x
>>>
>>> def false(x, y):
>>> return
Alec Taylor writes:
> On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
> wrote:
>> def true(x, y):
>> return x
>>
>> def false(x, y):
>> return y
[...]
>> def Nand(a, b):
>> return (lambda c: lambda x, y: c(y, x))(a(b, a))
>>
>> and we're done. [...]
> Awesome
Yes, that's how Church d
On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
wrote:
> Roy Smith wrote:
>
>> If you want to take it one step further, all the boolean operators can
>> be derived from nand (the dualists would insist on using nor).
>
> Let's define the boolean values and operators using just two functions:
>
> de
On Oct 8, 5:01 am, Steven D'Aprano wrote:
> Who like that second one speaks?
Yoda his name is. Programs in Forth he must.
--
http://mail.python.org/mailman/listinfo/python-list
On 08.10.2011 18:08, Steven D'Aprano wrote:
Let's define the boolean values and operators using just two functions:
[SNIP]
Have you just explained Church booleans in an understandable
language? Awesome. I still have to chew on this, but I think this is
the first time where I might understan
On Sat, Oct 08, 2011 at 12:34:42PM -0400, Roy Smith wrote:
> In article <4e906108$0$27980$426a3...@news.free.fr>,
> candide wrote:
>
> > After browsing source code, I realize that parenthesis are not necessary
> > ("not" has higher precedence than "in").
>
> Here's my take on parenthesis: If
In article ,
Jussi Piitulainen wrote:
>Mel writes:
>
>> Steven D'Aprano wrote:
>>
>> > candide wrote:
>> >
>> >> So what is the usefulness of the "not in" operator ? Recall what Zen of
>> >> Python tells
>&
In article ,
Chris Angelico wrote:
> I sent this email twelve hours ago but to the wrong mailing list
> *blush*. Since nobody else has raised the point, I'll repost it.
>
> On Sun, Oct 9, 2011 at 12:07 AM, Jussi Piitulainen
> wrote:
> > But both negations can be avoided by modus tollens.
> >
>
I sent this email twelve hours ago but to the wrong mailing list
*blush*. Since nobody else has raised the point, I'll repost it.
On Sun, Oct 9, 2011 at 12:07 AM, Jussi Piitulainen
wrote:
> But both negations can be avoided by modus tollens.
>
> "If you are able to start the car, the key is in th
On 09.10.2011 01:35, Tim Roberts wrote:
Roy Smith wrote:
In article<4e906108$0$27980$426a3...@news.free.fr>,
candide wrote:
After browsing source code, I realize that parenthesis are not necessary
("not" has higher precedence than "in").
Here's my take on parenthesis: If you need to look
Roy Smith wrote:
>In article <4e906108$0$27980$426a3...@news.free.fr>,
> candide wrote:
>
>> After browsing source code, I realize that parenthesis are not necessary
>> ("not" has higher precedence than "in").
>
>Here's my take on parenthesis: If you need to look up whether they're
>necessary
In article
,
rusi wrote:
> On Oct 8, 6:31 pm, Roy Smith wrote:
> > In article <87ehyn8xlp@dpt-info.u-strasbg.fr>,
> > Alain Ketterlin wrote:
> >
> > > Sure, but note that you can also reformulate != using not and ==, <
> > > using not and >=, etc. Operators like "not in" and "is not" sho
On Sun, Oct 9, 2011 at 3:31 AM, rusi wrote:
>> If you want to take it one step further, all the boolean operators can
>> be derived from nand (the dualists would insist on using nor).
>
>
>
I'm not sure what you're questioning, but it's possible to derive
On Oct 8, 6:31 pm, Roy Smith wrote:
> In article <87ehyn8xlp@dpt-info.u-strasbg.fr>,
> Alain Ketterlin wrote:
>
> > Sure, but note that you can also reformulate != using not and ==, <
> > using not and >=, etc. Operators like "not in" and "is not" should
> > really be considered single token
In article <4e906108$0$27980$426a3...@news.free.fr>,
candide wrote:
> After browsing source code, I realize that parenthesis are not necessary
> ("not" has higher precedence than "in").
Here's my take on parenthesis: If you need to look up whether they're
necessary or not, they are :-)
--
h
candide wrote:
> Le 08/10/2011 14:01, Steven D'Aprano a écrit :
>
> > And "not in" is the obvious way to do it.
>
> Obvious ? Not so. I performed some code mining and it appears that even
> good sources make use of "not (foo in bar)" expressions.
All that proves is that even expert Python dev
Le 08/10/2011 17:16, Dave Angel a écrit :
You should say
"... parenthesis are not necessary ("not" has LOWER precedence than "in")."
I should, yes, I confess ;)
In my defense, I must tell that Python document reference here :
http://docs.python.org/reference/expressions.html#summary
has
Roy Smith wrote:
> If you want to take it one step further, all the boolean operators can
> be derived from nand (the dualists would insist on using nor).
Let's define the boolean values and operators using just two functions:
def true(x, y):
return x
def false(x, y):
return y
That's
On 2011-10-08, Steven D'Aprano wrote:
> candide wrote:
>
>> So what is the usefulness of the "not in" operator ? Recall what Zen of
>> Python tells
>>
>> There should be one-- and preferably only one --obvious way to do it.
>
> And "not i
On Sun, Oct 9, 2011 at 2:16 AM, Dave Angel wrote:
> You should say
> "... parenthesis are not necessary ("not" has LOWER precedence than
> "in")."
>
Is "are not" an operator in English, or should this be "not
parentheses are necessary"?
ChrisA
--
http://mail.python.org/mailman/listinfo/pytho
Le 08/10/2011 17:13, Thorsten Kampe a écrit :
* candide (Sat, 08 Oct 2011 16:41:11 +0200)
After browsing source code, I realize that parenthesis are not
necessary ("not" has higher precedence than "in").
Lower precedence.
Ooops, thanks.
--
http://mail.python.org/mailman/listinfo/python-list
On 01/-10/-28163 02:59 PM, candide wrote:
Le 08/10/2011 12:42, candide a écrit :
>>> not ('th' in "python")
False
>>>
After browsing source code, I realize that parenthesis are not
necessary ("not" has higher precedence than "in").
You should say
"... parenthesis are not necessary
* candide (Sat, 08 Oct 2011 16:41:11 +0200)
> After browsing source code, I realize that parenthesis are not
> necessary ("not" has higher precedence than "in").
Lower precedence.
Thorsten
--
http://mail.python.org/mailman/listinfo/python-list
Le 08/10/2011 12:50, Jon Clements a écrit :
10 - 5 as 10 + -5 (as obviously the - is redundant as an operation),
and 10 / 2 as int(10 * .5) or something, who needs a divide!?
OK, I see your point but I was supposing non-membershipness seldom
needed and in fact one can suppose that test memb
On Sun, Oct 9, 2011 at 1:40 AM, candide wrote:
> A notin operator or isnot operator would be less confusing (at least in my
> case ;) ).
>
Let's replace both of them.
in --> foo extant bar
not in --> foo extinct bar
That would solve the problem, wouldn't it?
*ducking for cover*
ChrisA
--
htt
Le 08/10/2011 12:42, candide a écrit :
>>> not ('th' in "python")
False
>>>
After browsing source code, I realize that parenthesis are not necessary
("not" has higher precedence than "in").
--
http://mail.python.org/mailman/listinfo/python-list
Le 08/10/2011 14:01, Steven D'Aprano a écrit :
> And "not in" is the obvious way to do it.
>
>
Obvious ? Not so. I performed some code mining and it appears that even
good sources make use of "not (foo in bar)" expressions.
begin examples ***
from drpython/drPlugin
Le 08/10/2011 14:41, Alain Ketterlin a écrit :
Operators like "not in" and "is not" should
really be considered single tokens, even though they seem to use "not".
And I think they are really convenient.
I realize that I was confused by the lexical form of the "not in"
operator : it is made by
In article <87ehyn8xlp@dpt-info.u-strasbg.fr>,
Alain Ketterlin wrote:
> Sure, but note that you can also reformulate != using not and ==, <
> using not and >=, etc. Operators like "not in" and "is not" should
> really be considered single tokens, even though they seem to use "not".
> And I t
Mel writes:
> Steven D'Aprano wrote:
>
> > candide wrote:
> >
> >> So what is the usefulness of the "not in" operator ? Recall what Zen of
> >> Python tells
> >>
> >> There should be one-- and preferably only one --ob
Steven D'Aprano wrote:
> candide wrote:
>
>> So what is the usefulness of the "not in" operator ? Recall what Zen of
>> Python tells
>>
>> There should be one-- and preferably only one --obvious way to do it.
>
> And "not in" i
candide writes:
> Python provides
>
> -- the not operator, meaning logical negation
> -- the in operator, meaning membership
>
> On the other hand, Python provides the not in operator meaning
> non-membership. However, it seems we can reformulate any "not in"
> expression using only "not"
candide wrote:
> So what is the usefulness of the "not in" operator ? Recall what Zen of
> Python tells
>
> There should be one-- and preferably only one --obvious way to do it.
And "not in" is the obvious way to do it.
"If the key is not in the ignitio
So what is the usefulness of the "not in" operator ? Recall what Zen of
Python tells
There should be one-- and preferably only one --obvious way to do it.
the zen of python also says (amongst other things):
...
Readability counts.
...
Although practicality beats purity
...
Be
formulate any "not in"
> expression using only "not" and "in" operation. For instance
>
> >>> 'th' not in "python"
> False
>
> >>> not ('th' in "python")
> False
> >>>
>
> So what
"in" operation. For instance
>>> 'th' not in "python"
False
>>> not ('th' in "python")
False
>>>
So what is the usefulness of the "not in" operator ? Recall what Zen of
Python tells
There should be one-- and preferably only one --obvious way to do it.
--
http://mail.python.org/mailman/listinfo/python-list
51 matches
Mail list logo