Skip to content

Commit

Permalink
Changed to match the behavior of Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
buty4649 committed Jun 4, 2023
1 parent f7fe448 commit 399b01a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ In rf, you can use [special variables](https://docs.ruby-lang.org/ja/latest/clas
|-------|------|
| \_ | The input chunk |
| $\_ | Alias for \_ |
| $F | Alias for \_ |
| $F | It is an array that stores fields(`$F=_.split`) |
| \_1, \_2, \_3, ... | First field, second field, third field... |

## Built-in methods
Expand Down
2 changes: 1 addition & 1 deletion README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ rfではRubyで定義されている[特殊変数](https://docs.ruby-lang.org/ja
|-------|------|
| \_ | 入力されたチャンクです |
| $\_ | \_ のエイリアスです |
| $F | \_ のエイリアスです |
| $F | フィールドを格納した配列です(`$F=_.split`) |
| \_1, \_2, \_3, ... | 1番目、2番目、3番目のフィールドです |

## 組み込みメソッド
Expand Down
3 changes: 2 additions & 1 deletion mrblib/rf/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ def _
end

def _=(data)
$F = $_ = data
$F = data.split
$_ = data
end

def string?
Expand Down

0 comments on commit 399b01a

Please sign in to comment.