#syntacticsugar
Explore tagged Tumblr posts
yourbrotherinislam · 1 year ago
Text
Searching for objects across Databases in Snowflake
0 notes
kiasalehi · 6 years ago
Text
JavaScript Trivia I: Prototypal Inheritance
All JavaScript functions are also objects, and every object upon creation is assigned a prototype property, which is initialized to an empty object. We can define properties on this prototype object, such as the describe property on the Animal object below:
function Animal(name, color) { this.name = name; this.color = color; } Animal.prototype.describe = function() { console.log(`${this.name} is a ${this.color} animal!`); }
Sidenote: The above is equivalent to class Animal {... and a constructor function -- class syntax in JS is just syntactic sugar for a constructor function (just a capitalized function, by convention) and an associated prototype object.
Imagine you call a method on an object instance, like calling the method describe on the whale instance of the Animal object:
const whale = new Animal('Wilson', 'blue'); whale.describe(); // Wilson is a blue whale!
When we create whale as an instance of Animal, we are linking whale to Animal by a property whale.__proto__, which by definition points to the prototype object of Animal. I.e.:
whale.__proto__ === Animal.prototype // true
Now, when we call whale.describe(), the JS engine will first look in whale’s prototype (which is Animal's prototype) for the method. It finds it there, so it uses it. Awesome.
If it didn't find describe in that first prototype, it would look "up the prototype chain", i.e. at the object’s parent (Function), then the parent’s parent (Object). If it gets all the way to the base Object (from which all objects inherit) without finding the method in question, it assigns it the value undefined, potentially throwing an error depending on how you're referencing it.
The prototype chain also comes into play when we make one class inherit from another. Let's see what happens when we make a Cat class that inherits from Animal.
We want Cat to access everything Animal has, like name and color, but also to have the cat-specific property breed.
We can do this with class syntax:
class Cat extends Animal { constructor(name, color, breed) { super(name, color); this.breed = breed; } }
This creates a new Cat class with its own (initially empty) prototype object, and by including extends Animal we point its __proto__ property to Animal.prototype:
> Cat.__proto__ [Function: Animal]
You can technically use the old school syntax to set up this child-parent relationship as well:
function Cat(name, color, breed) { Animal.call(this, name, color); this.breed = breed; } Cat.__proto__ = Object.create(Animal.prototype);
Without the syntactic sugar of class and extend, we have to explicitly add Animal to Cat's prototype chain by pointing its __proto__ property to Animal's prototype (otherwise it would have pointed to Function.prototype by default).
This is closer to what we learned at App Academy but is deprecated according to MDN (link), so unless you are an expert I recommend you stick with the sugary version.
0 notes
kispuding · 8 years ago
Photo
Tumblr media
"Syntactic sugar" and "desugaring"
3 notes · View notes
aziraphales-library · 3 years ago
Note
do you have anything (preferably long but oneshots are alright as well) that uses stuff from the dead sea scrolls as a plot point? ive found one or two fics like that before and they always tend to be my favorites but i haven't seen any in a while
I don’t know of any, and can only find a few that even mention the dead sea scrolls...
Love Of My Life by SyntacticSugar (T)
Aziraphale gasped - breath leaving him as his heart stopped - his corporal form forgot completely it was supposed to be keeping up appearances.
The Dead Sea Scrolls remained in his hands. Stumbling upon a name, he read and re-read and then he felt a burning in his soul and knew.
“I know your name - I know it - and oh my world itself - my name is not Aziraphale.”
Crowley stiffens and looked at the angel shaking. Names are powerful things. That he didn’t know his own name - it was unthinkable.
“What is your name?” Crowley said, voice low. He did not want to know but was compelled. It felt as if they were rushing to a completion neither of them had any control of.
Biblically Known by PrincessDianaArtemis (T)
Crowley, besotted with the newest curator at the museum, lies about who she is to spend more time with him.
Aziraphale, academic that he is, knows that there's a fib in there somewhere, but doesn't want to expose it since he likes spending time with her too.
Planning Permission by blythely & circetigana (M)
Aziraphale has put memories away for centuries. Carefully filed them around far-flung corners of the island he has claimed as his Principality. As he and Crowley celebrate 1000 years of their Arrangement, he begins to wonder what he’s been missing. Crowley has plans of his own, plans that he wants to share. But with the angel looking to the past, he knows he’ll have to be patient about their future.
Or:
Aziraphale has hidden his regrets. Crowley has hidden his hopes. One day they’ll unpack them together.
Please let us know the fics you already know and love we we can rec them, too! And do our followers know of any others?
- Mod D
34 notes · View notes
acidted · 8 years ago
Video
Pevin Kinel - Systemic Risks. Bloopy, groovy #electronica from back after a long absence Pevin 
1 note · View note
ao3feed--reylo · 5 years ago
Text
It’s A Goddamn Arms Race
read it on the AO3 at https://ift.tt/2RRySp5
by SyntacticSugar
Exhausted, fresh from the shower and sitting haphazardly with his towel loose at his waist was the Supreme Leader Kylo Ren.
Only the Force knew why it decided it would be the time to connect them.
Rey must have been training. She was in simple clothes, with her staff, but she was soaked in sweat, hair clinging to her neck, chest and face red in effort. She was panting, and Ben found it difficult to meet her eyes. His eyes kept drifting to watch the movement of her heaving chest.
Her eyes were blown, dark and captivating. She involuntarily pulled in and sucked her bottom lip cleaning it of the salt and sweat. Ben found himself swallowing, as if he too was trying to drink the taste in her mouth.
Frozen, Ben watched her approach - willing to accept whatever she gave him. ‘Just a few feet more sweetheart.’
Words: 1551, Chapters: 1/1, Language: English
Fandoms: Star Wars - All Media Types, Star Wars Episode VII: The Force Awakens, Star Wars Episode VIII: The Last Jedi, Star Wars Episode IX: The Rise of Skywalker, Star Wars Sequel Trilogy
Rating: Explicit
Warnings: Creator Chose Not To Use Archive Warnings
Categories: F/M
Characters: Rey (Star Wars), Ben Solo | Kylo Ren, Ben Solo, Kylo Ren, The Force (Star Wars)
Relationships: Kylo Ren/Rey, Rey/Ben Solo | Kylo Ren, Rey/Ben Solo
Additional Tags: Force Bond (Star Wars), Smut, Plot What Plot/Porn Without Plot, Orgasm, Porn with Feelings
read it on the AO3 at https://ift.tt/2RRySp5
25 notes · View notes
our-fic-archive · 7 years ago
Link
Chapters: 1/1 Fandom: Preacher (TV) Rating: General Audiences Warnings: No Archive Warnings Apply Relationships: DeBlanc/Fiore Characters: Fiore (Preacher), DeBlanc (Preacher), Genesis (Preacher) Additional Tags: Language of Flowers, Angels, Demons, First Time (on Earth), Established Relationship, Flower of White Summary:
It started in Africa. Fiore was found staring at a patch of blue violets, where half had been stomped to death.
Reaching down he plucked one of the flattened ones, pealing it up from the ground and DeBlanc found it looking somehow pristine when he was presented with it.
“What’s this for?” He asked Fiore, knowing that he wasn’t going to get a clear response - knowing Fiore was still learning how to form English words in his new human body. “No waste.” He jumbled out and DeBlanc softened knowing what he meant.
He didn’t want it to go to waste; this flower influenced ever so slightly by Fiore’s ‘architecture’.
“Thank you my dear.” DeBlanc answered. Fiore made a contented sound. “Can you place it in the trunk?” Not yet knowing what to do with the gift given, Fiore could find a home for it. Maybe next to his comics.
0 notes
ao3feed4reylo · 7 years ago
Link
via AO3 works tagged 'Star Wars - All Media Types' read it on AO3 at http://ift.tt/2pypabW SyntacticSugar
by SyntacticSugar
There was empty blackness.
And then. There wasent.
He found himself in a large open field of flowers, wheat tuffs and long grass, all somehow vibrant with colors that glimmered like jewels.
Looking down at his hands, uncovered, his normal battle uniform cloaked him - thick tuffs of black leather looking faded grey - in the bright sunlight. It was warm, but a breeze rolls though as if on command, cooling the hint of heat.
He knew something was wrong. This was not a place he would find himself, let alone a place he doesn’t remember traveling to.
All breath left him as his soul hummed.
Rey.
It was a trap.
Words: 1429, Chapters: 1/1, Language: English
Fandoms: Star Wars Episode IIV: The Force Awakens, Star Wars Episode VIII: The Last Jedi, Star Wars - All Media Types, Star Wars Sequel Trilogy
Rating: Teen And Up Audiences
Warnings: No Archive Warnings Apply
Categories: F/M
Characters: Rey (Star Wars), Ben Solo | Kylo Ren, Ben Solo, Kylo Ren, The Force (Star Wars)
Relationships: Kylo Ren/Rey, Rey/Ben Solo | Kylo Ren, Rey/Ben Solo
Additional Tags: Force Bond (Star Wars), Resistance, First Order, dream - Freeform, Family
read it on AO3 at http://ift.tt/2pypabW
0 notes
ao3feed-kyloren · 7 years ago
Text
The Pro and Cons of Breathing
read it on AO3 at http://ift.tt/2HSaFHk
by SyntacticSugar
A thick tent, a large floor blanket and a thermal blanket covering Rey, with her fully clothed — it just was not enough - as her teeth rattled. She wished the wind didn't run though the broken ship as strong as it did, she could have found extra shelter in there if it hadn’t.
Unable to move much, to stay in the bundle of meager heat she created in the blankets, Rey wondered if it would be alright to doze - or if that was the potential hypothermia talking.
It’s shadow looming over her. She had been shaking cold for so long, her ball of self tucking as tight as she could. Rey couldn't tell if she had been here minutes or hours anymore, she was just so cold. She knew hallucinations were understandable at this point - but she still didn’t think that she would dream up a shirtless Ben Solo laying next to her.
Maybe she would.
Words: 2910, Chapters: 1/1, Language: English
Fandoms: Star Wars Episode IIV: The Force Awakens, Star Wars Episode VIII: The Last Jedi, Star Wars - All Media Types, Star Wars Sequel Trilogy
Rating: Teen And Up Audiences
Warnings: No Archive Warnings Apply
Categories: F/M
Characters: Rey (Star Wars), Ben Solo | Kylo Ren, Ben Solo, Kylo Ren, The Force (Star Wars)
Relationships: Kylo Ren/Rey, Rey/Ben Solo | Kylo Ren, Rey & Ben Solo | Kylo Ren, Kylo Ren & Rey, Rey & Ben Solo, Rey/Ben Solo
Additional Tags: Force Bond (Star Wars), Hypothermia, Resistance, First Order
read it on the AO3 at http://ift.tt/2HSaFHk
0 notes
wombatsblog-blog · 11 years ago
Text
Perl: syntactic sugar
$r = $s||'foo' # if ($s) { $r = $s } else { $r = 'foo' }; $r = $s//'foo' # if (defined $s) { $r = $s } else { $r = 'foo' }; $r ||= $s; # $r = $s unless ($r); $r //= $s; # $r = $s unless (defined $r); $r &&= $s; # $r = $s if ($r); $r = $c ? $s : $t; # if ($c) { $r = $s } else { $r = $t } $c ? $r : $s = $t; # if ($c) { $r = $t } else { $s = $t } $r = $s || $t; # if ($s) { $r = $s } else { $r = $t } $r = $s && $t; # if ($s) { $r = $t } else { $r = $s = undef, 0, untrue, etc. } $c and return $r; # return $r if ($c); $c or return $r; # return $r unless ($c); $c and $r = $s; # $r = $s if ($c); @$r{qw(a b c d)} # ($r->{a}, $r->{b}, $r->{c}, $r->{d})
0 notes
ao3feed--reylo · 7 years ago
Text
The Last of The Real Ones
read it on the AO3 at http://ift.tt/2pypabW
by SyntacticSugar
There was empty blackness.
And then. There wasent.
He found himself in a large open field of flowers, wheat tuffs and long grass, all somehow vibrant with colors that glimmered like jewels.
Looking down at his hands, uncovered, his normal battle uniform cloaked him - thick tuffs of black leather looking faded grey - in the bright sunlight. It was warm, but a breeze rolls though as if on command, cooling the hint of heat.
He knew something was wrong. This was not a place he would find himself, let alone a place he doesn’t remember traveling to.
All breath left him as his soul hummed.
Rey.
It was a trap.
Words: 1429, Chapters: 1/1, Language: English
Fandoms: Star Wars Episode IIV: The Force Awakens, Star Wars Episode VIII: The Last Jedi, Star Wars - All Media Types, Star Wars Sequel Trilogy
Rating: Teen And Up Audiences
Warnings: No Archive Warnings Apply
Categories: F/M
Characters: Rey (Star Wars), Ben Solo | Kylo Ren, Ben Solo, Kylo Ren, The Force (Star Wars)
Relationships: Kylo Ren/Rey, Rey/Ben Solo | Kylo Ren, Rey/Ben Solo
Additional Tags: Force Bond (Star Wars), Resistance, First Order, dream - Freeform, Family
read it on the AO3 at http://ift.tt/2pypabW
2 notes · View notes
ao3feed4reylo · 7 years ago
Link
via AO3 works tagged 'Star Wars - All Media Types' read it on AO3 at http://ift.tt/2HSaFHk SyntacticSugar
by SyntacticSugar
A thick tent, a large floor blanket and a thermal blanket covering Rey, with her fully clothed — it just was not enough - as her teeth rattled. She wished the wind didn't run though the broken ship as strong as it did, she could have found extra shelter in there if it hadn’t.
Unable to move much, to stay in the bundle of meager heat she created in the blankets, Rey wondered if it would be alright to doze - or if that was the potential hypothermia talking.
It’s shadow looming over her. She had been shaking cold for so long, her ball of self tucking as tight as she could. Rey couldn't tell if she had been here minutes or hours anymore, she was just so cold. She knew hallucinations were understandable at this point - but she still didn’t think that she would dream up a shirtless Ben Solo laying next to her.
Maybe she would.
Words: 2910, Chapters: 1/1, Language: English
Fandoms: Star Wars Episode IIV: The Force Awakens, Star Wars Episode VIII: The Last Jedi, Star Wars - All Media Types, Star Wars Sequel Trilogy
Rating: Teen And Up Audiences
Warnings: No Archive Warnings Apply
Categories: F/M
Characters: Rey (Star Wars), Ben Solo | Kylo Ren, Ben Solo, Kylo Ren, The Force (Star Wars)
Relationships: Kylo Ren/Rey, Rey/Ben Solo | Kylo Ren, Rey & Ben Solo | Kylo Ren, Kylo Ren & Rey, Rey & Ben Solo, Rey/Ben Solo
Additional Tags: Force Bond (Star Wars), Hypothermia, Resistance, First Order
read it on AO3 at http://ift.tt/2HSaFHk
0 notes