GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Introduce the Nil Object · Issue #136 · nodejs/node

Introduce the Nil Object #136

New issue
Copy link
New issue
Copy link
Closed
Closed
Introduce the Nil Object#136
Copy link

Description

@greelgorke
greelgorke
opened on Dec 10, 2014
Issue body actions

Hello and sorry in advance for all typos!

I'd like to introduce a new Object in the core, which consistently represents a null value but is not null. Why is this interesting?

One of the main pain points in Streams (not just core) is that null isn't a good choice for end-of-stream value in object mode. Highland.js resolves it with it's own _.nil value. But this works fine only for the same install. as soon as we have two dependencies, each having it's local highland dependencies, the _.nil check is flawed. a central instance would solve some pains here.

why core? it's the single point of truth in Node.js context. This value could also provide more interoperability to different user-land packages.

Activity

  1. phpnode commented on Dec 10, 2014

    @phpnode
    phpnode
    on Dec 10, 2014
    More actions

    @greelgorke I think this is backwards, the problem here is with the streams API not allowing null in some scenarios. Fix that and your problem goes away. Having to write a load of extra guards against Nil and null and undefined thoughout the codebase would be terrible.

  2. chrisdickinson commented on Dec 17, 2014

    @chrisdickinson
    chrisdickinson
    on Dec 17, 2014
    Contributor
    More actions

    I think this pain point is covered in #89. I was of the same mind re: adding a sentinel value to serve as EOF for readable streams, but I've since come around to the whatwg/streams-style of using a separate function from push to denote "closing" a stream. It is unlikely that we will take the sentinel object approach in enhancing streams in the future.

  3. chrisdickinson
    closed this as completedon Dec 17, 2014
  4. minervapanda
    added a commit that references this issue on Oct 9, 2016

    Fix narrowing to a stream by touching it in message lists.

    This issue will close once commit 1a0fc36 is merged into the 'master' branch.
    1a0fc36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.