[#86787] [Ruby trunk Feature#14723] [WIP] sleepy GC — ko1@...

Issue #14723 has been updated by ko1 (Koichi Sasada).

13 messages 2018/05/01
[#86790] Re: [Ruby trunk Feature#14723] [WIP] sleepy GC — Eric Wong <normalperson@...> 2018/05/01

ko1@atdot.net wrote:

[#87095] [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase — ko1@...

Issue #14767 has been updated by ko1 (Koichi Sasada).

9 messages 2018/05/17
[#87096] Re: [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase — Eric Wong <normalperson@...> 2018/05/17

ko1@atdot.net wrote:

[ruby-core:87109] [Ruby trunk Bug#14610] Enhance Proc docs

From: naruse@...
Date: 2018-05-17 07:25:33 UTC
List: ruby-core #87109
Issue #14610 has been updated by naruse (Yui NARUSE).

Tracker changed from Misc to Bug
Assignee set to docs
Backport set to 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN

----------------------------------------
Bug #14610: Enhance Proc docs
https://bugs.ruby-lang.org/issues/14610#change-72088

* Author: zverok (Victor Shepelev)
* Status: Open
* Priority: Normal
* Assignee: docs
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
What caught me recently while mentoring students: there is almost no "canonical" explanation about procs in [Ruby's core docs](https://docs.ruby-lang.org/en/trunk/): Nothing in `doc/*.rdoc`, and for the `Proc` class, documentation of what it is and what it does is pretty spartan.

I am trying to fix this by adding to `Proc` class header documentation.
Things added:

1. More friendly and detailed explanation of the whole concept.
2. Different methods of creating lambda and non-lambda procs.
3. Lambda semantics.
4. Conversion to proc from other objects and `&`.

About (3): currently, Proc docs _do have_ an explanation about it, but there are two problems:

* it all placed in docs for predicate method `#lambda?` (like nobody should be interested in the concept unless uses this method);
* from my perspective, it uses pretty unfortunate wording: instead of talking about proc object semantics, it calls non-lambdas behavior "tricks", and informally tells about "procs with tricks"/"procs without tricks".

If my class documentation would be accepted, I propose to cut the explanations in `#lambda?` method  down to a one-liner ("If the proc has lambda semantics. See class docs for an explanation about lambdas." or something like that.)

---Files--------------------------------
proc_docs.patch (6.41 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next