Building on the previous work by Kat Marchán.
Comparison with Python's newly-accepted pattern-match syntax.
Living Document. J. S. Choi, 2018-12.
The [WHATWG Fetch Standard][] contains several examples of using the DOM fetch
function, resolving its promises into values, then processing the values in
various ways. These examples may become more easily readable with smart pipelines.
Note: This is a distillation of @jschoi's excellent and thorough "Smart Mix Pipeline" proposal. @jschoi's proposal is perhaps too thorough, tho, and includes a number of optional features that I think muddy the waters and make the whole thing seem far more complex than it is.
So here's the minimal "topic-style pipeline" syntax I think we need, along with the two most important optional extensions only.
@bkardell proposes a switch()
function
for providing Container-Query-ish functionality inline in CSS.
The switch() function gets a bit complicated, tho, mixing two distinct and complex grammars (comparisons and <any-value>
) in one spot. It also doesn't let you style multiple properties together; you instead have to write multiple switch()es, one per property, and duplicate your tests, even if a property is only affected in one of the conditions.
Here's an alternate syntax proposal I think I like a little better. There is no change to the power of the proposal.
Create a new conditional rule, called @switch
. It is only allowed nested inside a style rule; if put at the top level, it's invalid.
The @switch contains rules; the prelude of each rule is a condition (which can use information evaluated against the element selectede by the outer style rule), the body is a set of properties to apply to the element when the condition matc
You are Xanthir, a rogue living in the kingdom of Larion. You have a long steel dagger and a length of rope. You walk down the city street looking for somehwere to steal from. You look around and see nothing that you can't get away with. You notice a group of soldiers walking along the road. They stop when they see you. | |
"What do you want?" One of them asks | |
> You say "Your money, or your life. Or both, I'm not picky.". | |
The soldier looks at you for a moment and then nods. He points to his sword and says "I'll take it". | |
You quickly grab the soldier's hand and pull him over to the side of the road. The soldier is surprised by this, but he doesn't resist |
```Oracle.DataAccess.Client.OracleException ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "AEG_NCALIFORNIA.TIX_CUSTOMER_DA", line 200 ORA-06512: at line 1 at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck) at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() at VA.Services.CustomerDA.InsertRow(TransactionContext tc, String lastName, String firstName, String middleName, String phone1, String phone2, String fax, Nullable1 isFemale, String email, String customerPassword, String companyName, Nullable
1 birthDay, String prefix, String suffix, String phone3, Nullable`1 phone1type, Nullable`1 phone2type, Nullable`1 phone3type, String salutation, String careof, String stateid, Nullable`1 optedin, Nullable`1 sentwelcomemsg, String notes, Nullable`1 securityquestionid, String securityanswer, Nullable`1 securityquestion2id, Stri
Currently, lock.asyncHold() isn't specced to take any arguments. It just returns a promise, and you pass the code you want to operate under the lock to the .then() method. This is problematic - it requires promise subclassing, and has some unintuitive and probably unexpected behavior.
For example, this code doesn't lock anything at all:
const p = lock.asyncHold();
...never call .then()...
This is extremely different from lock.hold(cb);
, which immediately acquires the lock (and calls the cb with it held).
class IO { | |
constructor(val) { | |
this._fn = ()=>val; | |
return this; | |
} | |
static fromFn(fn) { | |
const ret = new IO(); | |
ret._fn = fn; | |
return ret; | |
} |
{ | |
"css-animations-1": { | |
"aliasOf": "css3-animations" | |
}, | |
"css-backgrounds-3": { | |
"aliasOf": "css3-background" | |
}, | |
"css-box-3": { | |
"aliasOf": "css3-box" | |
}, |
CookieBot = { | |
$bigCookie: null, | |
$products: null, | |
running: true, | |
init: function() { | |
CookieBot.$bigCookie = document.querySelector("#bigCookie"); | |
CookieBot.$products = [].slice.call(document.querySelectorAll(".product")); | |
}, | |