DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Using Scheme In ASP

03.23.2006
| 3717 views |
  • submit to reddit
        ;The following example is in VBScript.  Any scripting language that uses com objects will be similar
;1 Install PLT Scheme - it will register the dlls
;2 Control Panel > Administrative Tools > Component Services
;   My Computer > DCOM Config > MzCOM
;   Properties > Security > Launch and Activation Permissions > Customize
;   Add Everyone or IUSR_<Computername> Allow Local Launch, Local Activation

;Output
;(define test (lambda () (+ 1 2 3 4 5)))
;15
strScheme = "(define test (lambda () (+ 1 2 3 4 5)))" 'Test Function
    
Set objScheme = Server.CreateObject("MzCOM.MzObj")   
result = objScheme.Eval(strScheme) 
result = objScheme.Eval("(test)")  'It remembers the function
Set objScheme = Nothing

Response.Write(strScheme & "<br>" & result & "<br>") 'Display Results