CSC 195.01 2013S Technologies for Mediascripting
[Skip to Body]
Primary:
[Front Door]
[Schedule]
-
[Academic Honesty]
[Disabilities]
[Instructions]
[Teaching and Learning]
Groups:
[Handouts]
[Outlines]
(Current Outline)
[EBoards]
(Current EBoard)
[Examples]
Misc:
[SamR]
[EBook]
[GNU Coding Standards]
This outline is also available in PDF.
Held: Thursday, 2 May 2013
Summary: We do a quick introduction to writing extensions for Racket.
Related Pages:
Notes:
scheme_initialize
, called when the code is first loaded.
scheme_module_name
, called when it has to query our code.
scheme_reload
, called when the code gets reloaded.
Scheme_Object
values. As you might
guess, a Scheme_Object
is Racket's beautiful generic type.
Scheme_Object * function (int argc, Scheme_Object *argv[]) { } // function * You can check types with fun things likeSCHEME_INTP
SCHEME_DOUBLEP
, and the ilk. * You can extract values withSCHEME_INT_VAL
,SCHEME_DOUBLE_VAL
, and such. * You install functions in two steps; First you make a function object and then you tell the environment about it. (This code typically goes in the reload function.) +scheme_make_prim_w_arity (proc, internal-name, min-arity, max-arity)
+scheme_add_global (extenal-name, result-of-prev-fun, env)
* Note that we have at least three names associated with the function. We'll play with changing each of these so that you can understand the difference.Compilation
raco ctool
for both tasks, just with different flags.
--cc
flag for compilation.
--ld
flag for linking.
(load-extension "prefix.so")
[Skip to Body]
Primary:
[Front Door]
[Schedule]
-
[Academic Honesty]
[Disabilities]
[Instructions]
[Teaching and Learning]
Groups:
[Handouts]
[Outlines]
(Current Outline)
[EBoards]
(Current EBoard)
[Examples]
Misc:
[SamR]
[EBook]
[GNU Coding Standards]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Wed May 1 10:51:48 2013.
The source to the document was last modified on Mon Jan 21 13:59:23 2013.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CSC195/2013S/outline.13.html
.
You may wish to
validate this document's HTML
;
;
http://creativecommons.org/licenses/by-nc/3.0/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.