Auto-convert list of integers to rect/point/color
For convenience and more concise code, it would be nice if procedures that accept an sdl2:rect, sdl2:point, or sdl2:color, could also accept a list of integers, automatically converting to the proper type. For example:
(sdl2:fill-rect! my-surf '(0 0 100 200) '(255 0 255))
;; would be equivalent to
(sdl2:fill-rect! my-surf (sdl2:make-rect 0 0 100 200) (sdl2:make-color 255 0 255))
This would only affect arguments, not return types. Procedures would still return the proper type. For example:
(sdl2:enclose-points '((0 0) (25 -1) (2 6) (-12 3)))
;; #<sdl2:rect (-12 -1 38 8)>
One possible concern here is ambiguity to humans: '(0 0 100 200)
could mean either a rect or an RGBA color, depending on where it is used. This could potentially make application code less clear, and make it harder to debug cases where the programmer accidentally switched the argument order.
But, I think the benefit of this feature would outweigh the potential for ambiguity. Programmers who are concerned about the ambiguity could continue to use the proper types in their own code.