There's a little forth program written in python here<br>#<a href="http://openbookproject.net/py4fun/forth/forth.py" target="_blank">http://openbookproject.net/py4fun/forth/forth.py</a><br>I'm struggling to understand what these lines mean.<br>
<br>def rJnz (cod,p) : return (cod[p],p+1)[ds.pop()]<br>def rJz (cod,p) : return (p+1,cod[p])[ds.pop()==0]<br><br>Specifically I'm stuck on what (code[p], followed by p+1 does inside the brackets <br>and also what [ds.pop()] abd [ds.pop==0] does afterwards<br>
I do know that <br>p is an integer <br>cod[p] is one of a list of functions that are stored in cod<br>
ds.pop() is popping the top of the ds list and <br>ds.pop() == 0 either means that the result popped is 0 or that there are no items left in list ds[]<br><br>Any help much appreciated