[#84280] [Ruby trunk Bug#14181] hangs or deadlocks from waitpid, threads, and trapping SIGCHLD — nobu@...
Issue #14181 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/12/15
[#84398] [Ruby trunk Bug#14220] WEBrick changes - failures on MSWIN, MinGW — Greg.mpls@...
Issue #14220 has been reported by MSP-Greg (Greg L).
3 messages
2017/12/22
[#84472] Re: [ruby-dev:50394] [Ruby trunk Bug#14240] warn four special variables: $; $, $/ $\ — Eric Wong <normalperson@...>
Shouldn't English posts be on ruby-core instead of ruby-dev?
3 messages
2017/12/26
[ruby-core:84210] [Ruby trunk Feature#14168] C call to raise FrozenError
From:
tagomoris@...
Date:
2017-12-12 12:25:33 UTC
List:
ruby-core #84210
Issue #14168 has been updated by tagomoris (Satoshi TAGOMORI).
Naruse told me about rb_check_frozen(), and it completely works as I expected.
Please close this ticket.
tagomoris (Satoshi TAGOMORI) wrote:
> Currently we need to check the object is frozen or not by `isFrozen` and raise error (RuntimeError or FrozenError) under its own responsibility.
> Providing such c function makes us to write much safer code/extensions.
>
> ```c
> /* now */
> if (OBJ_FROZEN(self)) {
> rb_raise(rb_eRuntimeError, "can't modify frozen Factory");
> }
>
> /* what I want to do */
> assert_is_not_frozen("MyAwesomeClass"); // raises RuntimeError (~2.4) or FrozenError (2.5~) if it is frozen
> // or
> assert_is_not_frozen(self); // classname? self VALUE?
> ```
>
> I want to reduce macros for ruby versions in out C extensions, so this feature will help us so much.
----------------------------------------
Feature #14168: C call to raise FrozenError
https://bugs.ruby-lang.org/issues/14168#change-68333
* Author: tagomoris (Satoshi TAGOMORI)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
Currently we need to check the object is frozen or not by `isFrozen` and raise error (RuntimeError or FrozenError) under its own responsibility.
Providing such c function makes us to write much safer code/extensions.
```c
/* now */
if (OBJ_FROZEN(self)) {
rb_raise(rb_eRuntimeError, "can't modify frozen Factory");
}
/* what I want to do */
assert_is_not_frozen("MyAwesomeClass"); // raises RuntimeError (~2.4) or FrozenError (2.5~) if it is frozen
// or
assert_is_not_frozen(self); // classname? self VALUE?
```
I want to reduce macros for ruby versions in out C extensions, so this feature will help us so much.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>