-- -*- M2-comint -*- hash: 6012612801132119664

i1 : mycos = foreignFunction("cos", double, double)

o1 = cos

o1 : ForeignFunction

i2 : mycos pi

o2 = -1

o2 : ForeignObject of type double

i3 : myatan2 = foreignFunction("atan2", double, {double, double})

o3 = atan2

o3 : ForeignFunction

i4 : myatan2(1, sqrt 3)

o4 = .5235987755982989

o4 : ForeignObject of type double

i5 : sprintf = foreignFunction("sprintf", void, {charstar, charstar},
         Variadic => true)

o5 = sprintf

o5 : ForeignFunction

i6 : buf = charstar "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

o6 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

o6 : ForeignObject of type char*

i7 : sprintf(buf, "%s %d", "foo", 3)

i8 : buf

o8 = foo 3

o8 : ForeignObject of type char*

i9 : sprintf(buf, "%s %.1f", "foo", 3)

i10 : buf

o10 = foo 0.0

o10 : ForeignObject of type char*

i11 : sprintf(buf, "%s %.1f", "foo", double 3)

i12 : buf

o12 = foo 3.0

o12 : ForeignObject of type char*

i13 : stopIfError = false

o13 = false

i14 : sprintf(buf, "%c", char' 77)
stdio:15:7:(3): error: libffi: bad argtype

i15 : malloc = foreignFunction("malloc", voidstar, ulong)

o15 = malloc

o15 : ForeignFunction

i16 : free = foreignFunction("free", void, voidstar)

o16 = free

o16 : ForeignFunction

i17 : x = malloc 8

o17 = 0x73f02406a8f0

o17 : ForeignObject of type void*

i18 : registerFinalizer(x, free)

i19 : 
