Madara's Ghost

C#

General discussions about the c# language, Squirrels | gist.gi...
Aug 12, 2020 14:15
@Squirrelkiller You're not a mathematically correctly marked diagram.
Aug 12, 2020 12:23
Because... wynaut?
Aug 12, 2020 12:23
Aug 12, 2020 12:21
@Squirrelintraining That there exist people who are unaware of the Wednesday meme.
Aug 12, 2020 12:20
Aug 12, 2020 12:18
It is Wednesday, my dudes!
Aug 12, 2020 12:15
This is how it appears to me. i.sstatic.net/PBHX2.png
Aug 12, 2020 12:14
That doesn't make YouTube links to appear on SO chat tho, right?
Aug 12, 2020 12:14
Honestly? Nowadays I use Discord and Telegram 🤷
Aug 12, 2020 11:42
omg omg omg a flag
Aug 12, 2020 11:41
IIRC rlemon got the :whatever: list from somewhere, and manually added :), :D, etc.
Aug 12, 2020 11:40
( Í¡° ͜ʖ Í¡°)
Aug 12, 2020 11:39
Sure, but I also have :lenny: and :shrug:
Aug 12, 2020 11:36
Also emojis 😃
Aug 12, 2020 11:36
@Squirrelintraining Stylus is great, but the plugin also adds things like unoneboxing, youtube previews, etc.
Aug 12, 2020 11:34
Aug 12, 2020 11:20
@Squirrelkiller Experimental.
Aug 12, 2020 11:16
It was really fun, too
Aug 12, 2020 11:16
Aye, I was really invested :D
Aug 12, 2020 11:15
Aug 12, 2020 11:15
I don't know what you mean.
Aug 12, 2020 11:12
@Squirrelintraining Insanity
Aug 12, 2020 09:26
@CaptainObvious Apparently so.
Aug 12, 2020 09:20
How's everyone?
Aug 12, 2020 09:20
I happened across @Squirrelintraining's plea on my resignation post on Meta, and figured I'd drop by for a visit
Apr 22, 2020 15:37
github.com/pardeike/Harmony – this is pretty badass
Apr 22, 2020 15:37
Has anyone here every worked with Harmony before?
Apr 22, 2020 15:36
More mirrors for your mirrors?
Apr 22, 2020 15:34
How about more mirrors for your flowers?
Apr 22, 2020 15:28
foreach (var i in EndlessCounter().Take(5)) {
  Log(i); // 0, 1, 2, 3, 4 is logged
}
Apr 22, 2020 15:27
public IEnumerable<int> EndlessCounter() {
  var i = 0;
  while (true) {
    yield i++;
  }
}
Apr 22, 2020 15:26
btw @CaptainObvious using yield return you can make infinite IEnumerables
Apr 22, 2020 15:14
But this is part of a larger generator method
Apr 22, 2020 15:14
@Squirrelkiller Yes, if that was all
Apr 22, 2020 15:10
foreach (var x in xs) yield return x; it is
Apr 22, 2020 15:10
Apparently such a thing that I want doesn't exist.
Apr 22, 2020 15:01
function* prompt() {
  console.log('What is your name?');
  const name = yield;
  console.log(`Hello ${name}!`);
}

const iter = prompt(); // iter is an iterator object.
// What is your name? printed
iter.next('Madara');
// Hello Madara! printed
Apr 22, 2020 15:00
I'll have you know that I'm a Wizard Ninja. Thank you very much.
Apr 22, 2020 15:00
In JS, you can send values back in
Apr 22, 2020 14:59
In C#, yield return may only return values to outside of the function
Apr 22, 2020 14:59
JS's are even more powerful
Apr 22, 2020 14:58
This is somewhat equivalent to Linq's .Where() ^
Apr 22, 2020 14:58
@CaptainObvious Yes, it is lazily evaluated
Apr 22, 2020 14:57
public IEnumerable<T> filter<T>(IEnumerable<T> xs, Predicate<T> p) {
  foreach (var x in xs) {
    if (p(x)) { yield return x; }
  }
}
Apr 22, 2020 14:56
eg
Apr 22, 2020 14:55
Which can then be consumed with foreach
Apr 22, 2020 14:55
@CaptainObvious yield return is a convenient way to write iterators
Apr 22, 2020 14:53
Do you know C#'s yield return?