Plaster
New
List
Login
text
apl
aspx
asterisk
brainfuck
c
c++hdr
c++src
cassandra
ceylon
clojure
clojurescript
cmake
cobol
coffeescript
common-lisp
crystal
csharp
css
cypher-query
cython
d
dart
diff
django
dockerfile
dylan
ebnf
ecl
ecmascript
edn
eiffel
ejs
elm
erb
erlang
ez80
factor
fcl
feature
forth
fortran
fragment
gfm
go
gql
groovy
gss
haml
handlebars-template
haskell
haxe
hive
html
http
httpd-php
httpd-php-open
hxml
ini
java
javascript
json
jsp
jsx
julia
kotlin
latex
less
literate-haskell
lua
mariadb
markdown
mbox
mirc
mscgen
msgenny
mssql
mumps
mysql
n-triples
nesc
nginx-conf
nsis
objectivec
octave
oz
pascal
perl
pgp
pgp-keys
pgp-signature
pgsql
php
pig
plsql
properties
protobuf
puppet
python
q
rpm-changes
rpm-spec
rsrc
ruby
rustsrc
sas
sass
scala
scheme
scss
sieve
slim
smarty
solr
soy
sparql-query
spreadsheet
sql
squirrel
stex
styl
swift
systemverilog
tcl
textile
tiddlywiki
tiki
tlv
tornado
ttcn-asn
ttcn-cfg
turtle
twig
typescript
typescript-jsx
vb
vbscript
velocity
verilog
vertex
vhdl
vue
webidl
xml
xml-dtd
xquery
xu
yaml
z80
default
Annotating paste
1646
Here is the second test that did not get pasted in the original paste. (defun test4 () (let* ((*readtable* (copy-readtable objc:*objc-readtable*)) (method-name "substringWithRange:") (method-info (find "GSCString" (gethash method-name objc:*methods*) :key (lambda (x) (slot-value x 'objc::class-name)) :test #'equal)) (num-args (+ 2 (objc::num-args method-info))) (cif (sb-alien:make-alien (sb-alien:struct ffi::ffi-cif))) (args (sb-alien:make-alien (* (sb-alien:struct ffi::ffi-type)) num-args)) (vals (ffi:malloc (* num-args ffi:*word-size*))) (rc (ffi:malloc ffi:*word-size*)) (ns-str (#/initWithCString: (#/alloc 'gs-base::ns-string) (sb-alien:alien-sap (sb-alien:make-alien-string "abc")))) (ns-str-ptr (ffi:malloc ffi:*word-size*)) (sel (objc:selector method-name)) (sel-ptr (ffi:malloc ffi:*word-size*)) (range-ptr (sb-alien:alien-sap (gs-base::ns-make-range 0 1)))) (setf (sb-alien:deref args 0) (sb-alien:addr ffi::ffi-type-pointer)) (setf (sb-alien:deref args 1) (sb-alien:addr ffi::ffi-type-pointer)) (setf (sb-alien:deref args 2) gs-base::*ns-range-type*) (setf (sb-sys:sap-ref-sap ns-str-ptr 0) ns-str) (setf (sb-sys:sap-ref-sap sel-ptr 0) sel) (setf (sb-sys:sap-ref-sap vals 0) ns-str-ptr) (setf (sb-sys:sap-ref-sap vals 8) sel-ptr) (setf (sb-sys:sap-ref-sap vals 16) range-ptr) (when (= ffi:ffi-ok (ffi:ffi-prep-cif cif ffi:ffi-default-abi num-args (sb-alien:addr ffi::ffi-type-pointer) args)) (format t "prepped cif!~%") (ffi:ffi-call cif (objc::method-getimplementation (objc::method-ptr method-info)) rc vals) (format t "called!~%") rc)))