Rand Stats

Japanese

zef:slavenskoj

Japanese - 日本語 Raku Module

A Raku module that provides Japanese language bindings for programming in Raku.

Installation

zef install Japanese

Usage

use Japanese;
# or
use 日本語;

# Constants
say;           # True
say;           # False
say();         # Nil
say 円周率;       # π (pi)

# Math operations
say 足す(2, 3);        # 5 (add)
say 引く(10, 3);       # 7 (subtract)
say 掛ける(4, 5);      # 20 (multiply)
say 割る(20, 4);       # 5 (divide)
say 累乗(2, 3);        # 8 (power)

# String operations
say 長さ("こんにちは");     # 5 (length)
say 大文字("hello");       # HELLO (uppercase)
say 逆順("あいうえお");     # おえういあ (reverse)

# Array operations
my @配列 = <りんご みかん ぶどう>;
say 最初(@配列);           # りんご (first)
say 最後(@配列);           # ぶどう (last)
say 合計([1, 2, 3, 4]);    # 10 (sum)

# Type checking
say 数値か(42);            # True (is-number)
say 文字列か("text");      # True (is-string)
say リストか(@配列);       # True (is-list)

# Control flow
もし 真 {
    言う("これは真です");  # This is true
}

各々 @配列 -> $果物 {
    印刷("$果物 ");       # Print each fruit
}

# Operators
say 5 足す 3;             # 8
say 10 引く 3;            # 7
say 4 掛ける 5;           # 20
say 20 割る 4;            # 5
say 5 より大きい 3;       # True
say 2 より小さい 5;       # True
say 42 等しい 42;         # True

Features

Constants and Nil

Math Functions

String Functions

Array Functions

Type Checking

I/O Functions

Operators

License

Artistic-2.0

Author

Danslav Slavenskoj