The prim construct in Stratego allows calls to 'primitive' functions. This makes it easy to include external library functionality without further language extensions.

Currently (StrategoRelease092) a primitive function can be called with a list of term arguments:

   prim("foo", t1, ..., tn)

A typical example is the following strategy definition from the posix-process.str module:

  execvp = ?(file, argv); prim("SSL_execvp", file, argv)
which calls the SSL_execvp function defined in a C library, passing it the terms bound to the variable file and argv.

It would be beneficial if primitive functions could have strategy arguments as well.

   prim("foo", s1, ..., sn | t1, ..., tn)

This feature will be available in StrategoRelease093.

-- EelcoVisser - 11 Jul 2003

Revision: r1.2 - 12 Aug 2003 - 09:01 - EelcoVisser
Stratego > ReleasePlan > ReleasePlan > NativePrimitives
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback