This comes from _fun, which define-gl expands to, https://docs.racket-lang.org/foreign/foreign_procedures.html#%28form._%28%28lib._ffi%2Funsafe..rkt%29.__fun%29%29
The first -> is a type spec for the C function's return type and the second -> is the output expression that is what the Racket wrapper will return. Jay -- Jay McCarthy Associate Professor @ CS @ UMass Lowell http://jeapostrophe.github.io Vincit qui se vincit. On Fri, Apr 10, 2020 at 10:02 AM Hendrik Boom <hend...@topoi.pooq.com> wrote: > > I'm building the new opengl binding for Racket, and keep running > into surprises. > > Most of them are straightforward, but tedious, but I run into > something strange. It's a piece of syntax in the original > (presumably) corrent, but obsolete, binding -- specifically, > a strange type. > > I thought I should ask before blundering through with it. > > Here's the definition for glAreProgramsResidentNV as present in > the existing binding: > > > (define-gl glAreProgramsResidentNV 2 ((n : _int32) (programs : (_u32vector > i)) (residences : (_vector o _bool n)) -> (result : _bool) -> (values result > residences)) (->> exact-integer? u32vector? (values boolean? (vectorof > boolean?))) check-gl-error) > > > Now normally the define-gl macro seems to take > a number, > a type of the function (containing names for the parameters > in the style of typed Racket's lambda arguments), and > another type to put in the documentation. > > Now the type of the function here is > ((n : _int32) (programs : (_u32vector i)) (residences : (_vector o _bool n)) > -> (result : _bool) -> (values result residences)) > > An ordinary enough looking type except that -> occurs twice. > > **: Is this a known Racket construct? > > Or is it something peculiar to define-gl, which I'll just have > to figure out as I build the new opengl binding. It's presumably > related to the fact that the 'residences' parameter is for output. > > -- hendrik > > > In case anyone is interested, here are the relevant > machine-readable bits from the nes and the old Khronos API specifications > > > The xml specfile entry for this is: > > <command> > <proto group="Boolean"><ptype>GLboolean</ptype> > <name>glAreProgramsResidentNV</name></proto> > <param><ptype>GLsizei</ptype> <name>n</name></param> > <param len="n">const <ptype>GLuint</ptype> > *<name>programs</name></param> > <param group="Boolean" len="n"><ptype>GLboolean</ptype> > *<name>residences</name></param> > <glx type="vendor" opcode="1293"/> > </command> > > > And here's the old specfile entry from the old Khronos opengl standard: > > AreProgramsResidentNV(n, programs, residences) > return Boolean > param n SizeI in value > param programs UInt32 in array [n] > param residences Boolean out array [n] > category NV_vertex_program > dlflags notlistable > version 1.2 > extension soft WINSOFT NV10 > glxflags ignore > glxvendorpriv 1293 > offset 578 > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/20200410140217.b4e5xizymwunvyu6%40topoi.pooq.com. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAJYbDakT1AXhd7zBK%2BHQ%2B5-z6RnkoHj__xxyGAD6vDXt21mWrA%40mail.gmail.com.