@webqit/subscript
Advanced tools
Comparing version 2.1.19 to 2.1.20
@@ -11,3 +11,3 @@ { | ||
"homepage": "https://webqit.io/tooling/subscript", | ||
"version": "2.1.19", | ||
"version": "2.1.20", | ||
"license": "MIT", | ||
@@ -14,0 +14,0 @@ "repository": { |
@@ -31,3 +31,3 @@ # Subscript Function Proposal | ||
**Problem is:** in the real world, the concept of “contract” isn't in the design of literal assignment expressions as we have in theory above (nor does it exist in any other imperative operation). **One must have to model the equivalent of an imperative expression in functional programming - to have a chance to ensure that the “contract” is kept!** | ||
**Problem is:** in the real world, the concept of “contract" isn't in the design of literal assignment expressions as we have in theory above (nor does it exist in any other imperative operation). **One must have to model the equivalent of an imperative expression in functional programming - to have a chance to ensure that the “contract" is kept!** | ||
@@ -85,3 +85,3 @@ Consider how the following theoretical reactive code would be constructed across a selection of frameworks (ignoring completeness and perfectionism): | ||
*Subscript Function* is a proposed function primitive that provides this *reactive programming context* within JavaScript. It “keeps the contract” for the individual expressions and statements that go into its context! | ||
*Subscript Function* is a proposed function primitive that provides this *reactive programming context* within JavaScript. It “keeps the contract" for the individual expressions and statements that go into its context! | ||
@@ -143,3 +143,3 @@ These functions go with a notation as in below... | ||
A reactive programming context must be explicitly designated. So we propose using a double star (`**`) on the function syntax <a href=”#discussion-points”><sup><small>Discussion Point 1</small></sup></a>. (And this would be just one star extra on the standard syntax for [Generator Functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator) `function* gen() {}`.) | ||
A reactive programming context must be explicitly designated. So we propose using a double star (`**`) on the function syntax <a href="#discussion-points"><sup><small>Discussion Point 1</small></sup></a>. (And this would be just one star extra on the standard syntax for [Generator Functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator) `function* gen() {}`.) | ||
@@ -267,3 +267,3 @@ ```js | ||
```js | ||
// This. (Having the “message” variable as a dependency.) | ||
// This. (Having the “message" variable as a dependency.) | ||
let fullMessage = [ message, ' ', 'Thank you!' ].join( '' ); | ||
@@ -273,3 +273,3 @@ ``` | ||
```js | ||
// This. (Having the “fullMessage” variable as a dependency, in addition to the “candidate.username” property.) | ||
// This. (Having the “fullMessage" variable as a dependency, in addition to the “candidate.username" property.) | ||
let broadcast = { [ candidate.username ]: fullMessage }; | ||
@@ -279,3 +279,3 @@ ``` | ||
```js | ||
// These two. (Having the “broadcast” variable as a dependency.) | ||
// These two. (Having the “broadcast" variable as a dependency.) | ||
let broadcastInstance = new BroadcastMessage( broadcast ); | ||
@@ -287,3 +287,3 @@ console.log( broadcast ); | ||
Subscript Functions employ a mix of compile-time and runtime heuristics to deliver fine-grained reactivity. This lets us enjoy the full range of language features without “loosing” reactivity or trading performance. | ||
Subscript Functions employ a mix of compile-time and runtime heuristics to deliver fine-grained reactivity. This lets us enjoy the full range of language features without “loosing" reactivity or trading performance. | ||
@@ -379,3 +379,3 @@ For example, expressions that reference deep object properties are bound to updates that actually happen along those paths. | ||
An “else/if” block is taken as a standalone contract nested within the “else” block of a parent “if/else” contract. In other words, the two forms below are functionally equivalent. | ||
An “else/if" block is taken as a standalone contract nested within the “else" block of a parent “if/else" contract. In other words, the two forms below are functionally equivalent. | ||
@@ -425,3 +425,3 @@ ```js | ||
Expressions with logical and ternary operators also work as conditional contracts. These expressions are bound to references in their “test” expression. | ||
Expressions with logical and ternary operators also work as conditional contracts. These expressions are bound to references in their “test" expression. | ||
@@ -440,3 +440,3 @@ ```js | ||
In all conditional constructs above, the contract is that updates to the “test” expressions themselves result in the rerun of the appropriate branch of the construct. The selected branch is rerun *as a block*, not in *fine-grained* execution mode. | ||
In all conditional constructs above, the contract is that updates to the “test" expressions themselves result in the rerun of the appropriate branch of the construct. The selected branch is rerun *as a block*, not in *fine-grained* execution mode. | ||
@@ -455,3 +455,3 @@ ```js | ||
But being each a contract of their own, individual expressions and statements inside a conditional context also respond to update events in isolation. This time, the conditions in context have to be “true” for the expression or statement to rerun. | ||
But being each a contract of their own, individual expressions and statements inside a conditional context also respond to update events in isolation. This time, the conditions in context have to be “true" for the expression or statement to rerun. | ||
@@ -469,7 +469,7 @@ So, above, the `addBadge()` and `removeAllBadges()` expressions are both bound to the reference `candidate`. But on an update to `candidate`, only one of these expressions is run depending on the state of the condition in context - `testExpr`. | ||
…all conditions in context (`parentTestExpr` >> `testExpr`) have to be “true” for an update to take place. | ||
…all conditions in context (`parentTestExpr` >> `testExpr`) have to be “true" for an update to take place. | ||
In all cases, the "state" of *all conditions in context* are determined via *memoization*, and no re-evaluation ever takes place on the “test” expressions. | ||
In all cases, the "state" of *all conditions in context* are determined via *memoization*, and no re-evaluation ever takes place on the “test" expressions. | ||
“Switch” statements and logical and ternary expressions have this fine-grained behaviour in their own way. | ||
“Switch" statements and logical and ternary expressions have this fine-grained behaviour in their own way. | ||
@@ -480,3 +480,3 @@ ### Loops | ||
#### A “for” Loop, “while” And “do … while” Loop | ||
#### A “for" Loop, “while" And “do … while" Loop | ||
@@ -509,3 +509,3 @@ A "for" loop is bound to references in its 3-statement definition. | ||
#### A "for ... of" And “for … in” Loop | ||
#### A "for ... of" And “for … in" Loop | ||
@@ -569,3 +569,3 @@ These loops are bound to references in their *iteratee*. | ||
A “for … of, for … in” loop further has the unique characteristic where each round of the loop maintains a direct relationship with its corresponding key in the *iteratee*. Now, on updating the value of a key in `iteratee` in-place, the associate round (specifically) also runs in-place to keep its contract. | ||
A “for … of, for … in" loop further has the unique characteristic where each round of the loop maintains a direct relationship with its corresponding key in the *iteratee*. Now, on updating the value of a key in `iteratee` in-place, the associate round (specifically) also runs in-place to keep its contract. | ||
@@ -694,3 +694,3 @@ ```js | ||
1. Enable reactivity directly *at the program flow level* - with commands, operators, control flow and other language constructs literally compiling as “contracts”, as against the alternative of painstakingly remodeling same in functional programming or other syntaxes. | ||
1. Enable reactivity directly *at the program flow level* - with commands, operators, control flow and other language constructs literally compiling as “contracts", as against the alternative of painstakingly remodeling same in functional programming or other syntaxes. | ||
2. Keep the business of change detection *out of scope* (that is, don't be concerned with how changes are observed); simply accept change events from the outer scope. | ||
@@ -697,0 +697,0 @@ 3. Implement Subscript Function as an extension of standard JavaScript functions, such that either can be used interchangeably, or where necessary, code can be easily ported between function types. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3698955