Chaining is a Lucid Dreaming technique which takes advantage of the post-dream state - the awakening often following a dream. It seems to have a rather high success rate, yet isn't widely known as a primary approach, like all these -ILDs we have floating around - WILD, MILD, DILD, NILD, and so forth ad infinitum. The much neater name "Chaining" distinguishes itself from the rest in both name and approach.

What you do is go to bed, not even worrying about having a lucid dream. That's right, forget about your intention to lucid dream. Instead, focus on not moving at all when you awaken. Don't open your eyes, don't lift your head, don't do anything. When you wake up, do not move at all; stillness should be instinctive.

From this point, you should be able to get into a lucid dream without much trouble, WILD-style. It's like floating in a black void, and all you have to do is visualize a little bit and a dream will begin to form. In addition, you should repeatedly state that you are dreaming. Once your (hopefully lucid) dream is over, you should be able to get several more through the same not-moving stuff. This is what makes Chaining such a powerful lucid dreaming technique - you can actually, with practice, trigger several lucid dreams in a row, one at a time. Once you get familiar with this technique, try to shoot for three in a row, but don't get too greedy or you might lose lucidity.

So, in summary:

  1. Have a dream. This shouldn't take much effort, assuming you have a Central Nervous System.
  2. Wake up and don't move - remain completely still.
  3. Slip back into the dream state, as if WILDing.
  4. Have a lucid dream. Improvise! Remember to maintain stability within the dream.
  5. Lather, Rinse, Repeat.

As you can see, this technique utilizes a significantly different mindset than the normal LD techniques, in that it doesn't emphasize intention before sleep, and thus it might work well for people who haven't had volumes of success with the more traditional techniques. If you're new to lucid dreaming, you might want to try the well known and established methods instead. But, if you've been practicing for some time without much success, or you wish to increase the quantity of your lucid dreaming, then by all means give Chaining a go.

In object oriented programming, chaining means that some functions will return a reference to the object instance, allowing another call to a function of that object.

Wait, what?

An example would probably make more sense.

Suppose we have an object/class that has two functions, foo and bar. If those functions return a reference to the original object then these functions could be chained together, like so:

var object = new MyObject();; //or we could do longer chains

Observe, this means that you don't have to do

var object = new MyObject();;;

Of course you can still do that but the chained version is a little more succinct and a little cooler. It's like how in natural languages one can say a few things within one sentence rather than stopping after every proposition.

A slightly more imaginative example.

If you imagine that the original class was some kind of collection, like an array or list then you could do things like:

function level3person(person)
  return (person.level > 3);
var people = new e2UserCollection();

  .find("e2users") //get all e2 people
  .filter(level3person) //filter the ones above level 3
  .addXP(100) //give them 100 xp
  .each(function(person) { person.msg("You gained 100 XP"); }); //now tell them about it

The above was created in not-so-pseudo Javascript however you can do it in C++ and I'd say pretty much any object oriented language.

How to do it?

Basically just return a reference back to the object instance as the last line of appropriate function. In Javascript, you would do something like this :

e2UserCollection.prototype = {
  //...obviously other code is here 
  find : function(whotofind) {
    //code you'd put to find people
    return this; //the magical part that sets up the chain
  //lather, rinse, repeat for the other functions

If you were doing this in C++ you would do something like:

class Foo {
  //constructors + stuff
  Foo& chaining_function();

Foo& Foo::chaining_function()
  return *this; //as usual, it's uglier in C++

Typical candidates for this is when your class has functions that don't return anything otherwise (i.e. they don't compute something and return it).

Also just remember not to over do it. Like natural languages, it's okay to stop to take a breath every now and then.

Update : raincomplex informs me that this isn't always possible. Specifically

In Python, there are cases in the standard library where chaining is explicitly disallowed in order to prevent confusion as to whether the (modified) instance returned is the same as or a copy of the instance on which the method was called (examples: list.sort() and list.reverse()---they return None)

Log in or register to write something here or to contact authors.