Re:Compile-time JSON deserialization in C++
by ArtixFox on Thursday July 11, 2024 @03:00PM
(#40939518)
what does (the ....) do?
[ Parent
| on HN ]
You can also get the same result by declaring the function's type:
* (declaim (ftype (function (fixnum fixnum) fixnum) fx-add))
(FX-ADD)
* (defun fx-add (x y)
(declare (optimize (speed 3) (safety 0) (debug 0)))
(+ x y))
FX-ADD
* (disassemble 'fx-add)
; disassembly for FX-ADD
; Size: 6 bytes. Origin: #x552C81A6 ; FX-ADD
; 6: 4801FA ADD RDX, RDI
; 9: C9 LEAVE
; A: F8 CLC
; B: C3 RET
NIL> what does (the ....) do?
Specifies the type of the form. In this example, it tells the CL compiler that the returned `(+ x y)` is a `fixnum`.