hclang 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -370,17 +370,20 @@ export class Frame extends MetaFrame {
370
370
  * and never of the source, which is why no source has to declare an element
371
371
  * type. Nothing is materialized on the receiver's behalf.
372
372
  *
373
- * An empty stream answers nil whatever it started from: a reduce with nothing
374
- * to work with has no result to report, and answering the seed would report a
375
- * value that never took part.
373
+ * An empty stream answers the receiver it started from. The receiver is the
374
+ * accumulator before any element arrives, so a fold over nothing is that
375
+ * accumulator: an empty collect is `[]`, an empty join `“”`, an empty product
376
+ * `1`. This is what keeps a reduce compositional, since folding a whole stream
377
+ * must equal folding its first part and continuing from that answer, even
378
+ * when the first part is empty.
376
379
  */
377
380
  reduce(receiver, receiverState) {
378
381
  return Frame.reduceInto(this.elements(), receiver, receiverState);
379
382
  }
380
- /** Threads one stream through a receiver, answering nil for an empty one. */
383
+ /** Threads one stream through a receiver, answering the receiver for an empty one. */
381
384
  static reduceInto(values, receiver, receiverState) {
382
385
  if (values.length === 0) {
383
- return Frame.nil;
386
+ return receiver;
384
387
  }
385
388
  return values.reduce((accumulator, value) => accumulator.call(value, Frame.nil, receiverState), receiver);
386
389
  }
@@ -1 +1 @@
1
- export const VERSION = "0.18.0";
1
+ export const VERSION = "0.19.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hclang",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "Homoiconic C command-line interpreter and REPL",
5
5
  "keywords": [
6
6
  "language",