racket / racket/rhombus

Imperative pipelines (“tap” operators)

Open
#741 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
601
Forks
74
Avg merge
2d 10h
Merged PRs (30d)
5

Description

Some languages provide pipeline operators or alike for use with imperative functions/methods:

  • Clojure provides doto that works like ->, except that each forms are evaluated and discarded, and the original value is returned. For example, (doto (new java.util.HashMap) (.put "a" 1) (.put "b" 2)) initiates a Java mutable hash table (see the ClojureDocs page).
  • In Kotlin, .apply (with receiver) and .also (with argument) are available as extension methods on objects (see Kotlin scope functions).
  • (Unfortunately, I couldn’t find a precedent on a .- or |>-like tap operator.)

This operation is also known as “tap” or “tee”. Is this a useful addition to Rhombus?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by comparing Rhombus's existing pipeline facilities with Clojure's doto and Kotlin's apply/also semantics, then determine whether a tap operation fits Rhombus and what syntax and behavior it would require. Done would mean an agreed feature direction and an implementation scope.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.