There's a little forth program written in python here
#http://openbookproject.net/py4fun/forth/forth.py
I'm struggling to understand what these lines mean.
def rJnz (cod,p) : return (cod[p],p+1)[ds.pop()]
def rJz (cod,p) : return (p+1,cod[p])[ds.pop()==0]
Specifically I'm stuck on what
On Mon, May 21, 2012 at 2:52 AM, e-mail mgbg25171
mgbg25...@blueyonder.co.uk wrote:
def rJnz (cod,p) : return (cod[p],p+1)[ds.pop()]
def rJz (cod,p) : return (p+1,cod[p])[ds.pop()==0]
Specifically I'm stuck on what (code[p], followed by p+1 does inside the
brackets
(cod[p],p+1) is a
On Sun, May 20, 2012 at 10:52 AM, e-mail mgbg25171
mgbg25...@blueyonder.co.uk wrote:
There's a little forth program written in python here
#http://openbookproject.net/py4fun/forth/forth.py
I'm struggling to understand what these lines mean.
def rJnz (cod,p) : return (cod[p],p+1)[ds.pop()]
On 5/20/2012 1:16 PM, Ian Kelly wrote:
On Sun, May 20, 2012 at 10:52 AM, e-mail mgbg25171
mgbg25...@blueyonder.co.uk wrote:
There's a little forth program written in python here
#http://openbookproject.net/py4fun/forth/forth.py
I'm struggling to understand what these lines mean.
def rJnz
J Rice wrote:
I'm sorry for such a basic question, but I haven't been able to phrase
a search that gets me an answer and my books are totally silent on
this. I have seen a number of python function defs that take
parameters of the form (**param1). Looks like a pointer... but my
books on
Scott David Daniels [EMAIL PROTECTED] writes:
At the risk of being thought of as beating a dead horse, this was a
_great_ way to ask this question. [...]
So, anyhow, thanks for taking the time to write your question properly.
Take that risk, please. There's enough lambasting of (and probably
I'm sorry for such a basic question, but I haven't been able to phrase
a search that gets me an answer and my books are totally silent on
this. I have seen a number of python function defs that take
parameters of the form (**param1). Looks like a pointer... but my
books on python (basic as they
On 20 Mar 2006 12:46:43 -0800 in comp.lang.python, J Rice
[EMAIL PROTECTED] wrote:
I'm sorry for such a basic question, but I haven't been able to phrase
a search that gets me an answer and my books are totally silent on
this. I have seen a number of python function defs that take
parameters of
in the parameter list, **param gets a dict of arguments that dont
correspond to somthing in the formal parameter list.
More examples in the python docs:
http://docs.python.org/tut/node6.html#SECTION00672
--
Jordan T. Greenberg
--
J Rice wrote:
I'm sorry for such a basic question, but I haven't been able to phrase
a search that gets me an answer and my books are totally silent on
this. I have seen a number of python function defs that take
parameters of the form (**param1). Looks like a pointer... but my
books on
Wow, this is incredibly useful! I can understand why an introductory
book wouldn't make use of them, but I am really glad to know about
them. I can think of a bunch of ways to simply some code I have using
this.
--
http://mail.python.org/mailman/listinfo/python-list
In article [EMAIL PROTECTED],
Dave Hansen [EMAIL PROTECTED] wrote:
On 20 Mar 2006 12:46:43 -0800 in comp.lang.python, J Rice
[EMAIL PROTECTED] wrote:
I'm sorry for such a basic question, but I haven't been able to phrase
a search that gets me an answer and my books are totally silent on
this. I
On 20 Mar 2006 15:45:36 -0800 in comp.lang.python,
[EMAIL PROTECTED] (Aahz) wrote:
In article [EMAIL PROTECTED],
Dave Hansen [EMAIL PROTECTED] wrote:
[...]
It's harder to explain than understand. Try playing with the
following function in the python interpreter:
def test(a,b='b', *c, **d):
Dave Hansen wrote:
On 20 Mar 2006 15:45:36 -0800 in comp.lang.python,
[EMAIL PROTECTED] (Aahz) wrote:
Personally, I think it's a Good Idea to stick with the semi-standard
names of *args and **kwargs to make searching easier...
Agreed (though kwargs kinda makes my skin crawl).
On Mon, 20 Mar 2006, Ben Cartwright wrote:
Dave Hansen wrote:
On 20 Mar 2006 15:45:36 -0800 in comp.lang.python,
[EMAIL PROTECTED] (Aahz) wrote:
Personally, I think it's a Good Idea to stick with the semi-standard
names of *args and **kwargs to make searching easier...
Agreed (though
Aahz wrote:
Personally, I think it's a Good Idea to stick with the semi-standard
names of *args and **kwargs to make searching easier...
I usually do stick to these names (since the I usually only use them
when forwarding arguments to another function, where such names are a
pretty good
16 matches
Mail list logo