queck #5722(2008/02/10 13:20 GMT) [ Other ] Rating0/0=0.00
Factor です。シンプルに文字列に変換しました。
スタックベースの言語では、2つ以上の値(多値)を返すには、スタックに必要な数だけ値を残すという自然な方法で実現できます。
1 2 3 4 5 6 7 8 9 10
USING: kernel sequences math math.functions math.parser ; : keta&kurai ( n -- keta kurai ) number>string length dup 1- 10 swap ^ ; ! example USE: prettyprint 2469 keta&kurai . . ! 1000 4 600 keta&kurai . . ! 100 3 1 keta&kurai . . ! 1 1
Rating0/0=0.00-0+
[ reply ]
queck
#5722()
[
Other
]
Rating0/0=0.00
Factor です。シンプルに文字列に変換しました。
スタックベースの言語では、2つ以上の値(多値)を返すには、スタックに必要な数だけ値を残すという自然な方法で実現できます。
USING: kernel sequences math math.functions math.parser ; : keta&kurai ( n -- keta kurai ) number>string length dup 1- 10 swap ^ ; ! example USE: prettyprint 2469 keta&kurai . . ! 1000 4 600 keta&kurai . . ! 100 3 1 keta&kurai . . ! 1 1Rating0/0=0.00-0+
[ reply ]