Seeker
14a92f9705
Add Hash#except [Ruby 3.0]
2020-12-27 16:33:12 -08:00
dearblue
f0a64329b1
Prohibit array changes by "a"/"*" specifier of mrb_get_args()
...
The "a"/"*" specifier of the `mrb_get_args()` function will now return `const mrb_value *`.
This is because it is difficult for the caller to check if it is an array object and write-barrier if necessary.
And it requires calling `mrb_ary_modify()` on the unmodified array object, which is also difficult (this is similar to #5087 ).
2020-10-22 22:55:35 +09:00
Yukihiro "Matz" Matsumoto
fc8fb41451
Small refactoring in hash_slice; ref #4926
2020-01-10 17:57:33 +09:00
KOBAYASHI Shuji
ac213907d7
Remove unneeded dependency from mruby-hash-ext
2019-11-08 20:40:20 +09:00
KOBAYASHI Shuji
ea2424d36d
Drop test dependency from mruby-hash-ext to mruby-enumerator
2019-11-06 18:57:35 +09:00
Yukihiro "Matz" Matsumoto
57a0132b41
Add filter aliases for Enumerable and Hash.
2019-09-16 10:10:09 +09:00
Yukihiro "Matz" Matsumoto
610bcc88c2
Removed to_hash conversion method.
2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto
5bbcea9b3b
Removed try_convert method from Array and Hash.
2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto
8ffd4e47fb
Use mrb_undef_value for delete mark instead of shifting Hash entry table.
...
That means entry table should be compacted periodically by `sg_compact()`.
2018-09-26 23:09:48 +09:00
Yukihiro "Matz" Matsumoto
3820ef791f
Small refactoring in mruby-hash-ext.
2018-09-20 09:07:24 +09:00
Yukihiro "Matz" Matsumoto
62e8e910b2
Reimplement Hash#compact! to conform the standard behavior.
...
`Hash#compact!` should return `nil` if the receiver does not change.
2018-08-06 16:40:19 +09:00
Yukihiro "Matz" Matsumoto
ad17ba0e11
KeyError from Hash#fetch should inspect key.
...
To distinguish string keys and symbol keys.
2017-12-25 23:52:40 +09:00
Yukihiro "Matz" Matsumoto
421819dc2c
Add Hash#slice [Ruby 2.5]
2017-12-25 23:43:37 +09:00
Yukihiro "Matz" Matsumoto
df68a3345d
assert_equal() takes result as the first argument
2017-12-25 15:39:45 +09:00
Yukihiro "Matz" Matsumoto
ce916b99b8
Add Hash#to_proc; CRuby2.3
2017-10-18 10:18:43 +09:00
Yukihiro "Matz" Matsumoto
44f07045d1
Add Hash#fetch_values; CRuby2.3
2017-10-18 10:05:39 +09:00
Clayton Smith
5dc688fb12
Check whether internal khash is initialized in Hash#compact!
2017-08-17 12:13:41 -04:00
Yukihiro "Matz" Matsumoto
9826ca54f2
VM stack may be reallocated during mrb_hash_get; fix #3771
2017-08-10 08:21:43 +09:00
Yukihiro "Matz" Matsumoto
6c61a60609
Implement Hash#compact! in C; ref #3769
2017-08-09 21:20:50 +09:00
vvakame
4d46f366ac
add method(compact, compact!) and test of Hash to mruby-hash-ext
2017-08-09 19:18:02 +09:00
Christopher Aue
3359b86ec7
Improved speed of enumeration methods
2017-07-30 13:19:31 +02:00
Yukihiro "Matz" Matsumoto
515a093213
Add Hash#transform_keys! and Hash#transform_values.
2017-07-15 08:51:35 +09:00
Yukihiro "Matz" Matsumoto
d7fef24a95
Use keys.each instead of unstable each_keys.
2017-07-15 08:50:52 +09:00
Yukihiro "Matz" Matsumoto
460d628490
Remove duplication in mruby-hash-ext test.
2017-07-14 16:10:26 +09:00
Yukihiro "Matz" Matsumoto
de3edcc170
Add Hash#transform_{keys,values} to mruby-hash-ext.
2017-07-14 15:13:41 +09:00
Yukihiro "Matz" Matsumoto
a18904a4c2
Use "$!" specifier of mrb_get_args.
2017-07-12 14:49:55 +09:00
Kouhei Sutou
e72e50b5d5
Hash sub class creates new sub class objects instead of Hash
2017-03-21 23:25:36 +09:00
Yukihiro "Matz" Matsumoto
817b884343
add #dig tests
2016-03-23 12:34:32 +09:00
Yukihiro "Matz" Matsumoto
daf83946bb
add #dig to Array,Hash and Struct
2016-03-23 11:49:28 +09:00
Yukihiro "Matz" Matsumoto
5c405dea3d
include changed from by quotes ("") to by brackets (<>); close #3032
2015-11-27 17:48:23 +09:00
takahashim
621487a0cd
add {Array|Hash|String}.try_convert
2015-11-24 08:39:39 +09:00
Yukihiro "Matz" Matsumoto
fa86026a99
move Hash comparison methods to mruby-hash-ext gem
2015-11-15 05:15:20 +09:00
Seba Gamboa
25c8e95365
Revert "Mark core gems with mrbgem tag"
...
This reverts commit 5cdcce8dbd .
2015-10-21 14:31:13 -03:00
Seba Gamboa
13b552538a
Remove obvious warnings from docs
2015-10-20 12:48:31 -03:00
Seba Gamboa
5cdcce8dbd
Mark core gems with mrbgem tag
2015-10-20 12:16:47 -03:00
Jun Hiroe
570c261555
Refator Hash.fetch test
2015-09-26 09:58:36 +09:00
Asmod4n
4bd98671bc
Problem: Hash#fetch doesn't raise KeyError when a key cannot be found
...
Solution: change the Exception class raised to KeyError when a key
cannot be found.
2015-09-17 13:28:09 +02:00
takahashim
b88ca625ab
fix block variable in Hash#fetch
2015-09-16 02:57:41 +09:00
Jun Hiroe
4e4929bc72
Rename extended xxxx class or module to xxxx class or module extension
2015-06-28 11:18:52 +09:00
Jun Hiroe
c69d1201e1
Fix typo; Replace extensional with extended
2015-06-28 00:05:58 +09:00
Franck Verrot
2588507285
Remove unnecessary backticks.
...
Dr Markus Kuhn published in 1999 an article [1] explaining in details
why we shouldn't use the ASCII grave accent (0x60) as a left quotation.
Backticks have been used most notably to produce nice-looking LaTeX
documents but it doesn't seem to be an issue on modern platforms and
for the oldest ones, there are workarounds as mentioned by Dr Kuhn.
[1]: https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
2015-06-24 13:07:07 +02:00
Yukihiro "Matz" Matsumoto
50f54529f2
to_hash/to_a check in Hash[] should only be done when only one argument is given; ref #2594
2014-09-19 01:14:50 +09:00
INOUE Yasuyuki
5f16c41753
copy documentation comment from CRuby
2014-09-18 17:43:38 +09:00
INOUE Yasuyuki
d30aadf306
remove line number from raise message
2014-09-18 17:37:48 +09:00
INOUE Yasuyuki
e66d86a5fb
refactor Hash generator loop
2014-09-18 16:07:27 +09:00
INOUE Yasuyuki
5603b8d79f
implement Hash.[]
2014-09-06 22:50:06 +09:00
take_cheeze
4a6c651f82
Run mrbgem and core tests on minimum dependencies.
...
Solves #2355 .
In test drivers:
* Uses `mrb_t_pass_result` to check and pass test result to main `mrb_state`.
* Adds `mrb_init_test_driver` to init test `mrb_state`.
2014-07-12 20:36:45 +09:00
Yukihiro "Matz" Matsumoto
172060877a
add Hash#to_h; ref #2348
2014-06-04 18:57:31 +09:00
yui-knk
d88a9d761f
Add comment to Hash#each_pair. And change the line
...
Add comment about ISO.
Current place is misleading so change line No.
2014-05-10 20:16:19 +09:00
yui-knk
658a00ba49
Change to raise TypeError (Hash#merge, #merge!)
2014-05-10 10:18:15 +09:00