]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/com/wrapper/wrapper-docs.factor
factor: remove """ string syntax for now. there are HEREDOC:, STRING:, escaping ...
[factor.git] / basis / windows / com / wrapper / wrapper-docs.factor
index a9004c0b24309e613e206f2ed9a04451db20f78c..ea77f31c4d38597512ecfdf59f761ce1c0023af9 100644 (file)
@@ -6,7 +6,7 @@ IN: windows.com.wrapper
 HELP: <com-wrapper>
 { $values { "implementations" "an assoc relating COM interface names to arrays of quotations implementing that interface" } { "wrapper" "a " { $link com-wrapper } " tuple" } }
 { $description "Constructs a " { $link com-wrapper } " tuple. Each key in the " { $snippet "implementations" } " assoc must be the name of an interface defined with " { $link POSTPONE: COM-INTERFACE: } ". The corresponding value must be an array of quotations implementing the methods of that interface in order, including those of its parent interfaces. The " { $snippet "IUnknown" } " methods (" { $link IUnknown::QueryInterface } ", " { $link IUnknown::AddRef } ", and " { $link IUnknown::Release } ") will be defined automatically and must not be specified in the array. These quotations should have stack effects mirroring those of the interface methods being implemented; for example, a method " { $snippet "void foobar ( int foo, int bar )" } " should be implemented with a quotation of effect " { $snippet "( this foo bar -- )" } ". The " { $snippet "this" } " parameter (that is, the leftmost parameter of any COM method) will be automatically converted from an alien pointer to the underlying Factor object before the quotation is invoked.\n\nThe resulting wrapper can be applied to a Factor object using the " { $link com-wrap } " word. The COM interface pointer returned by " { $snippet "com-wrap" } " can then be passed to C functions requiring a COM object as a parameter. The vtables constructed by " { $snippet "<com-wrapper>" } " are stored on the non-GC heap in order to be accessible to C functions; when the wrapper object and its vtables are no longer needed, the object's resources must be freed using " { $link dispose } ".\n\nExample:" }
-{ $code """
+{ $code "
 COM-INTERFACE: ISimple IUnknown {216fb341-0eb2-44b1-8edb-60b76e353abc}
     HRESULT returnOK ( )
     HRESULT returnError ( ) ;
@@ -20,17 +20,17 @@ COM-INTERFACE: IUnrelated IUnknown {b06ac3f4-30e4-406b-a7cd-c29cead4552c}
     int xMulAdd ( int mul, int add ) ;
 
 {
-    { "IInherited" {
+    { \"IInherited\" {
         [ drop S_OK ]    ! ISimple::returnOK
         [ drop E_FAIL ]  ! ISimple::returnError
         [ x>> ]          ! IInherited::getX
         [ >>x drop ]     ! IInherited::setX
     } }
-    { "IUnrelated" {
+    { \"IUnrelated\" {
         [ [ x>> ] [ + ] bi* ]   ! IUnrelated::xPlus
         [ [ x>> ] [ * ] [ + ] tri* ] ! IUnrealted::xMulAdd
     } }
-} <com-wrapper>""" } ;
+} <com-wrapper>" } ;
 
 HELP: com-wrap
 { $values { "object" "The factor object to wrap" } { "wrapper" "A " { $link com-wrapper } " object" } { "wrapped-object" "A COM object referencing " { $snippet "object" } } }