More correct pretty printing of cdata types - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/matrix.lua
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年11月22日 10:08:57 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年11月22日 10:14:10 +0100
commit7287e0c622822abbdc69dc14b9bffa83593e1db2 (patch)
tree03e7f23fb7dc1b6dbdfa34b1f32a6357a0a558e2 /matrix.lua
parentea6856d9e4475338b9908f5ab7e8e9379e61309f (diff)
downloadgsl-shell-7287e0c622822abbdc69dc14b9bffa83593e1db2.tar.gz
More correct pretty printing of cdata types
Diffstat (limited to 'matrix.lua')
-rw-r--r--matrix.lua 11
1 files changed, 4 insertions, 7 deletions
diff --git a/matrix.lua b/matrix.lua
index 4e60391b..19390dfc 100644
--- a/matrix.lua
+++ b/matrix.lua
@@ -960,13 +960,10 @@ matrix.tr = function(a)
matrix.def = matrix_def
matrix.cdef = matrix_cdef
-local reg = debug.getregistry()
+local register_ffi_type = debug.getregistry().__gsl_reg_ffi_type
-function reg.__gsl_ffi_type(a)
- if ffi.istype(gsl_complex, a) then return "complex"
- elseif ffi.istype(gsl_matrix, a) then return "matrix"
- elseif ffi.istype(gsl_matrix_complex, a) then return "complex matrix" end
- return "cdata"
-end
+register_ffi_type(gsl_complex, "complex")
+register_ffi_type(gsl_matrix, "matrix")
+register_ffi_type(gsl_matrix_complex, "complex matrix")
return matrix
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月27日 08:13:18 +0000

AltStyle によって変換されたページ (->オリジナル) /