Esempio n. 1
0
IO_METHOD(IoSeq, at)
{
	/*doc Sequence at(aNumber)
	Returns a value at the index specified by aNumber.
	Returns nil if the index is out of bounds.
	*/

	size_t i = IoMessage_locals_sizetArgAt_(m, locals, 0);
	UArray *a = DATA(self);

	//IOASSERT((i < UArray_size(DATA(self))), "index out of bounds");
	if(i >= UArray_size(DATA(self))) return IONIL(self);

	if(UArray_isFloatType(a))
	{
		return IONUMBER(UArray_doubleAt_(a, i));
	}
	else
	{
		return IONUMBER(UArray_longAt_(a, i));
	}
}
Esempio n. 2
0
File: IoBox.c Progetto: ADTSH/io
static double UArray_y(UArray *self) { return UArray_doubleAt_(self, 1); }
Esempio n. 3
0
File: IoBox.c Progetto: ADTSH/io
static double UArray_x(UArray *self) { return UArray_doubleAt_(self, 0); }