Code center > Suggestions

dupbool

<< < (3/5) > >>

Gobo:
It would be cool to have also over operators, which copy the second value on the top of the stack ( a b -- a b a ). For example:

--- Code: ---if ( A ) {
    if ( B ) {
        C
    }
    else {
        D
    }
}
else {
    E
}
--- End code ---
could be then coded as:

--- Code: ---A dupbool B overbool overbool and C dropbool not and D dropbool not E dropbool
--- End code ---

MacadamiaNuts:
Wacky. Why not a general operator that returns the value at a specified backwards position in the stack?

like:
{a b c d e f}

3 return = value d
5 return = value b

But then, evolved DNA may lose the little sequencial readability it had.

I suspect a forward-only GoTo could be more straightforward for flow forking. And it would be a lovely retro addition, too.  

I betcha, someday we will be able to code Emacs in DB DNA.

Gobo:

--- Quote from: MacadamiaNuts ---I suspect a forward-only GoTo could be more straightforward for flow forking. And it would be a lovely retro addition, too.  
--- End quote ---
Foo! If you head on DNA readability, goto is perhaps the thing you want the least

Numsgil:
An over operator is starting to push the boundary a bit.  Can you achieve the same effect using swap and dup somehow?  If it's really impossible to do using other operators, we might need to implement it, but I'm really leaning towards no on this.  Evolved DNA can get really wacky, so it's best to keep the language as straightforward as possible.

The good news is that for DB3, I'm implementing codules, which would (should) easily allow forking.

Gobo:

--- Quote from: Numsgil ---An over operator is starting to push the boundary a bit.  Can you achieve the same effect using swap and dup somehow?
--- End quote ---
I believe no.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version