/
ColdCore-3.0a9.02/
ColdCore-3.0a9.02/src/
new object $or_lock_frob: $or;

var $root created_on = 796268969;
var $root flags = ['methods, 'code, 'variables, 'core];
var $root managed = [$or_lock_frob];
var $root manager = $or_lock_frob;

public method .lock_name() {
    arg lock, @type;
    
    [(type ?= 'literal)] = type;
    switch (type) {
        case 'literal:
            return ((("(" + ((lock[1]).lock_name(type))) + " || ") + ((lock[2]).lock_name(type))) + ")";
        default:
            return (((lock[1]).lock_name(type)) + " or ") + ((lock[2]).lock_name(type));
    }
};

public method .new_lock() {
    arg lhs, rhs;
    
    if ((type(lhs) != 'frob) || (type(rhs) != 'frob))
        throw(~perm, "Arguments are not both frobs.");
    return (<this(), [lhs, rhs]>);
};

public method .try() {
    arg lock, obj;
    
    return ((lock[1]).try(obj)) || ((lock[2]).try(obj));
};