Code center > Suggestions

Gene structure - cond start stop

<< < (7/10) > >>

Botsareus:
Auto simplifing the command structute:

If we have

--- Quote ---A 'condition
A 'condition
and
C 'action
--- End quote ---
It is changed to

--- Quote ---A 'condition
C 'action
--- End quote ---

If we have

--- Quote ---A 'condition
A 'condition
or
C 'action
--- End quote ---
It is changed to

--- Quote ---A 'condition
C 'action
--- End quote ---

If we have

--- Quote ---conditionless
A 'condition
or
C 'action
--- End quote ---
It is changed to

--- Quote ---conditionless
C 'action
--- End quote ---

If we have

--- Quote ---conditionless
A 'condition
and
C 'action
--- End quote ---
It is changed to

--- Quote ---A 'condition
C 'action
--- End quote ---

  corrected

An else command simply works by reversing the top of the condition stack ex:


--- Quote ---A 'condition
B 'condition
C 'condition
or
else
or
--- End quote ---

means

not(B or C) or A

---
If there is a cndmove , cndmdup , or cndmtt, the above codes do not apply.
move , mdup and mtt, change negative values to positive once. But if any input values is zero they are changed to one.

Numsgil:

--- Quote from: EricL ---Sounds good to me.  So, I'll add four new commands:

clearbool   - empties the boolean stack.
clearint      - empties the integer stack
popbool     - pops a value off the boolean stack.
popint       - pops a value off the integer stack

Okay?
--- End quote ---

You could drop the int suffix, and have it just assumed.  So then you would have:

clearbool, clear, popbool, pop

Makes the syntax a little clearner, I think.

Gobo:
I'd also shorten 'bool' to just 'b' and put it in the beginning and changed 'pop' to 'drop' (which is more descriptive)

--- Code: ---drop
bdrop
clear
bclear
--- End code ---

Botsareus:
(see correction to the above post.)

More simplifications:


--- Quote ---A 'condition
B 'action
A
C 'action
--- End quote ---

is simplfied as


--- Quote ---A 'condition
B 'action
C 'action
--- End quote ---

If there is two elses in a row ex:

--- Quote ---conditionless
else
else
--- End quote ---

is simplfied as


--- Quote ---conditionless
--- End quote ---

---


--- Quote ---conditionless
else
B 'action
--- End quote ---

is simplfied as


--- Quote ---B 'action
--- End quote ---

---


--- Quote ---conditionless
A 'action
else
B 'action
--- End quote ---

is simplfied as


--- Quote ---B 'action
conditionless
A 'action
--- End quote ---

EricL:

--- Quote from: Numsgil ---You could drop the int suffix, and have it just assumed.  So then you would have:

clearbool, clear, popbool, pop
--- End quote ---
Personally, I like the specificity of popint and popbool but then my code always has longHardToReadLongVariableNames.


--- Quote from: Gobo ---I'd also shorten 'bool' to just 'b' and put it in the beginning and changed 'pop' to 'drop' (which is more descriptive)
--- End quote ---
I like 'bool' better than 'b' and I like 'pop' better than 'drop'.  Pop is the well understood term for popping a value off a stack and bool is more descriptive.

The code already supports sysvar synonyms: .aimdx and .aimright for example.  I could add built in operator synonyms or add an aliasing mechanism for DNA fiel parsing but I think I'll make it clearbool, clearint, popbool, popint for now.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version