Home /Modules/data-structures/DSMap.sleela

DSMap.sleela

data-structures/DSMap.sleela · 14 line(s) · sleela

#sleela 2.1

// Key/value association contract.

struct DSMap {
    int size;
}

class DSMapOperations {
    boolean empty(DSMap map) { return map.size == 0; }
    int size(DSMap map) { return map.size; }
    boolean hasEntries(DSMap map) { return map.size > 0; }
}