- ABORT
- ABORT"
- ABS
- ACCEPT
- ACTION-OF
- AGAIN
- ALIGN
- ALIGNED
- ALLOT
- AND
- BASE
- BEGIN
- BL
- BUFFER:
- [
- [CHAR]
- [COMPILE]
- [']
- CASE
- C,
- CELL+
- CELLS
- C@
- CHAR
- CHAR+
- CHARS
- COMPILE,
- CONSTANT
- COUNT
- CR
- CREATE
- C!
- :
- :NONAME
- ,
- C"
- DECIMAL
- DEFER
- DEFER@
- DEFER!
- DEPTH
- DO
- DOES>
- DROP
- DUP
- /
- /MOD
- .R
- .(
- ."
- ELSE
- EMIT
- ENDCASE
- ENDOF
- ENVIRONMENT?
- ERASE
- EVALUATE
- EXECUTE
- EXIT
- =
- FALSE
- FILL
- FIND
- FM/MOD
- @
- HERE
- HEX
- HOLD
- HOLDS
- I
- IF
- IMMEDIATE
- INVERT
- IS
- J
- KEY
- LEAVE
- LITERAL
- LOOP
- LSHIFT
- MARKER
- MAX
- MIN
- MOD
- MOVE
- M*
- -
- NEGATE
- NIP
- OF
- OR
- OVER
- 1-
- 1+
- PAD
- PARSE-NAME
- PARSE
- PICK
- POSTPONE
- +
- +LOOP
- +!
- QUIT
- RECURSE
- REFILL
- REPEAT
- RESTORE-INPUT
- R@
- ROLL
- ROT
- RSHIFT
- R>
- SAVE-INPUT
- SIGN
- SM/REM
- SOURCE-ID
- SOURCE
- SPACE
- SPACES
- STATE
- SWAP
- ;
- S\"
- S"
- S>D
- !
- THEN
- TO
- TRUE
- TUCK
- TYPE
- '
- *
- */
- */MOD
- 2DROP
- 2DUP
- 2/
- 2@
- 2OVER
- 2R@
- 2R>
- 2SWAP
- 2!
- 2*
- 2>R
- U.R
- UM/MOD
- UM*
- UNLOOP
- UNTIL
- UNUSED
- U.
- U<
- U>
- VALUE
- VARIABLE
- WHILE
- WITHIN
- WORD
- XOR
- 0=
- 0<
- 0>
- 0<>
- \
- .
- <
- >
- <>
- #>
- <#
- #
- #S
- (
- ?DO
- ?DUP
- >BODY
- >IN
- >NUMBER
- >R

# 6.1.1200 DEPTH CORE

( --

*+n*)
*+n* is the number of single-cell values contained in the
data stack before *+n* was placed on the stack.

## Testing:

T{ 0 1

T{ 0

T{

**DEPTH**-> 0 1 2 }TT{ 0

**DEPTH**-> 0 1 }TT{

**DEPTH**-> 0 }T## ContributeContributions

## MatteoVitturi [207] More general TestcaseSuggested Testcase2021-08-18 13:39:23

Hello all,

I was testing with Annex F Test Suite and got some unexpected error messages on the DEPTH testcases.

```
T{ 0 1 DEPTH -> 0 1 2 }T
T{ 0 DEPTH -> 0 1 }T
T{ DEPTH -> 0 }T
```

After some investigation, I realized that this is due to how the Test Harness is built, since current DEPTH testcases relies on an empty-stack, but that may not be always true.

To get around this ambiguity, I used the very same Test Suite's `START-DEPTH`

variable to adjust the value DEPTH returns.

```
T{ 0 1 DEPTH START-DEPTH @ - -> 0 1 2 }T
T{ 0 DEPTH START-DEPTH @ - -> 0 1 }T
T{ DEPTH START-DEPTH @ - -> 0 }T
\ or / and
T{ 0 1 DEPTH -> 0 1 2 START-DEPTH @ + }T
T{ 0 DEPTH -> 0 1 START-DEPTH @ + }T
T{ DEPTH -> 0 START-DEPTH @ + }T
```

I think the power of the test isn't decreased by this amendment.

_Matteo