Your example was wrong. I've used this:
: if (num_items_carried() < inventory_item_limit()) {
: pocket "object" ;
: print "You take the object.";
}
: else {
: print "You can't carry any more.";
}