[781] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: Stupid Question Time

daemon@ATHENA.MIT.EDU (Mon Aug 21 15:05:00 1995 )

Date: Mon, 21 Aug 1995 13:02:47 -0600
From: 869683 Gillespie Brandon James <brandon@paradise.declab.usu.edu>
To: coldstuff@MIT.EDU

< And, one woudl assume for your example, a error-type logicly or'd
< with a buffer yields the buffer in question.  Also, one would assume
< that a buffer or'd with another buffer produces.. what... the
< combined contents of both buffers?

No.  More examples (direct data, rather than variables):

    buffer = `[1,2,3] || `[50,29,20];

Because `[1,2,3] is logically true (whereas `[] is logically false), buffer
would be assigned `[1,2,3].  However:

    buffer = `[] || `[50,29,20];

buffer is assigned `[50,29,20].  Basically, doing:

    variable = (| func(args) |) || default;

Is the same as:

    catch any {
        variable = func(args);
    } with handler {
        variable = default;
    }

Or, based off the logically true/false aspect:

    variable = (| func(args) |);
    if (!variable)
        variable = default;

However, in all cases, the first example is the best (lest pcode to execute).

-Brandon