FFI: FFI-Kernel-mt.70.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FFI: FFI-Kernel-mt.70.mcz

commits-2
Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-mt.70.mcz

==================== Summary ====================

Name: FFI-Kernel-mt.70
Author: mt
Time: 19 May 2020, 4:18:35.480992 pm
UUID: 77eeead7-5f0d-6c4c-99c1-fc879d8c79e6
Ancestors: FFI-Kernel-mt.69

Print the type for external data in tools so one can quickly recognize 'char*' etc.

=============== Diff against FFI-Kernel-mt.69 ===============

Item was added:
+ ----- Method: ExternalData>>printOn: (in category 'printing') -----
+ printOn: stream
+
+ super printOn: stream.
+
+ stream
+ nextPut: $<;
+ print: type;
+ nextPut: $>.!


Reply | Threaded
Open this post in threaded view
|

Re: FFI: FFI-Kernel-mt.70.mcz

Eliot Miranda-2
Hi Marcel,

   re FFI-Kernel-mt.69, why not

externalLibraryFunction
"Answers the external library function that will be called when evaluating this method."

| result |
^self numLiterals > 0 ifTrue:
[(result := self literalAt: 1) class == ExternalLibraryFunction ifTrue: [result]]

It's so much more elegant than all those explicit [nil]'s.  We should know that ifTrue: et al answer nil when their block is not evaluated.

On Tue, May 19, 2020 at 7:18 AM <[hidden email]> wrote:
Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-mt.70.mcz

==================== Summary ====================

Name: FFI-Kernel-mt.70
Author: mt
Time: 19 May 2020, 4:18:35.480992 pm
UUID: 77eeead7-5f0d-6c4c-99c1-fc879d8c79e6
Ancestors: FFI-Kernel-mt.69

Print the type for external data in tools so one can quickly recognize 'char*' etc.

=============== Diff against FFI-Kernel-mt.69 ===============

Item was added:
+ ----- Method: ExternalData>>printOn: (in category 'printing') -----
+ printOn: stream
+
+       super printOn: stream.
+
+       stream
+               nextPut: $<;
+               print: type;
+               nextPut: $>.!




--
_,,,^..^,,,_
best, Eliot