I will not yield to yield

Struggling to bend my brittle mind around the concept of JS generator functions.. I roughly get the basic idea, but I'm studying an example on https://davidwalsh.name/es6-generators and I am looking at the messaging back and forth via the yield expression. It should be simple enough to understand. But I've struggled more than I want to admit. I understand that if you have a statement like: var v = (yield something); And call .next(1), v will in fact not be 1. something will be returned from that call, but v is not 1. Calling .next(2) after that, will yield nothing (done: true) and v will be 2. This seems one off to me. I'd have expect the first call to "next" to set v. But the second one does, this makes me uncertain of the application for this. But I guess it will come in time, just need to think harder. A colleague suggested that I try implementing the functionality of 3 nested loops with a generator function, I am fairly sure he was joking, but I'd still like to come up with a solution that is not 3 nested ifs. I could solve it with recursion, but not using any inherent property of the generator function.

Time flies

It's late, I've paused reading "we" because I got the NGE manga, and I'm enjoying that quite a bit, even if it's the same story as I've already watched multiple times, followed by all the movies. (See .png file from this date). I'm going offline now to read. Maybe the weekend will allow me the time to write the server class for the node gopher-lib that I started making. I think the client code is robust enough, and it's been tested out a lot from me using it in gopher-client (sudo npm install --global gopher-client), and I'm browsing gopher with it some times, but I do find overbite and firefox nicer when I'm on a machine with graphics (which is, honestly, most of the time). A shout out to Selmar at gopher://cloudb.zapto.org/ who has linked to this phlog! That's really cool! I will definitely link back! (When I rewrite my server so that I can actually make links without editing the source-code and restarting the whole thing.. Yes, I could use a ready-made server, but part of the experience for me, is that this is served by some of my own software).

Thoughts on bloat

Hmm, I didn't write the TCP/IP stack, the NIC driver, the kernel, the FS or the javascript VM that is used for serving you this.. Meaning, I maybe wrote 0.0000000001% of the code actually in use.. Maybe I should try and find an easy to use network chip and hook it up to some 8 bit MCU, and.. no.. no. well. Maybe I'll make do something like that, but it won't serve my whole site, just maybe one or two things.. Actually.. If it could read from an SD card, then I might be able to serve the whole thing, slowly, from a totally custom hardware platform.. I need to consider this.. Oh, who only had forever and and infinite amount of time. But I don't. By the way.. House plans are going forward! :) ---------> OUT !


2017-01-25-NGE.png (1 MiB)