Exemplo n.º 1
0
void
BucketHandler::handleSetCurrentState(const BucketId &bucketId,
                                     storage::spi::BucketInfo::ActiveState newState,
                                     IGenericResultHandler &resultHandler)
{
    _executor.execute(makeTask(makeClosure(this,
                                           &proton::BucketHandler::performSetCurrentState,
                                           bucketId, newState, &resultHandler)));
}
Exemplo n.º 2
0
void
BucketHandler::handlePopulateActiveBuckets(document::BucketId::List &buckets,
                                           IGenericResultHandler &resultHandler)
{
    _executor.execute(makeTask(makeClosure(this,
            &proton::BucketHandler::
            performPopulateActiveBuckets,
            buckets,
            &resultHandler)));
}
Exemplo n.º 3
0
LISP_DATA* eval(LISP_DATA* exp, LISP_DATA* env)
{
	printf("eval: ");
	printLispData(exp);
	printf("\n");

	if (exp->type == LIST)
	{
		if (!exp->data.list) 
			return exp;

		LISP_DATA* car = exp->data.list->head;

		if (isPrimitive(car)) 
		{
			return apply(car, evlist(exp->data.list->tail, env));
		}
		else if (car->type == SYMBOL && !stricmp(car->data.symbol, "define")) 
		{
			LISP_DATA_LIST* toBind = exp->data.list->tail->head->data.list;
			env = bindIdentifier(env, toBind->head, eval(toBind->tail->head, env));
			return 0;
		}
		else if (car->type == SYMBOL && !stricmp(car->data.symbol, "let")) 
		{
			LISP_DATA_LIST* toBind = exp->data.list->tail->head->data.list;
			env = bindIdentifier(env, toBind->head, eval(toBind->tail->head, env));
			LISP_DATA* body = eval(exp->data.list->tail->tail->head, env);
			env = popBinding(env);
			return body;
		}
		else if (car->type == SYMBOL && !stricmp(car->data.symbol, "lambda")) 
		{
			return makeClosure(exp->data.list->tail, env);
		}
		else 
		{
			return apply(eval(car, env), evlist(exp->data.list->tail, env));
		}
	}
	if (exp->type == SYMBOL) 
	{
		return lookup(exp, env);
	}
	if (exp->type == QUOTED) 
	{
		return exp->data.quoted;
	}

	return exp;
}