I have been inundated with L Sharp related email over the last few weeks – that’s great news, except that I haven’t been able to keep on top of it all, so here is a summary of the latest L Sharp progress.
The master source code repository for L Sharp is now available on the Sourceforge Subversion server at
https://svn.sourceforge.net /svnroot/lsharp
This should allow anybody to get the latest source and try out features which are, as yet unreleased. Information about accessing the Subversion repository can be found at http://sourceforge.net/docs/E09
Apart from several bug fixes and improvements, I’m excited to announce two major new features – event handling and web development. These are still experimental, but early adopters can grab the latest code and give it a try.
Event Handling
You can now properly add LSharp event handlers to controls on Windows Forms applications using handle-event or defevent. Here is a code example:
(reference "System.Windows.Forms")
(using "System.Windows.Forms")
(= f (new Form))
(defevent Click f (sender args)
(writeline console “You clicked x {0} y {1}” (x args) (y args)))
(spawn ’(run application f))
Web Application Development
We now have an HttpHandler which allows L Sharp to be used within ASP.NET applications.
Create a new ASP.NET 2 web application. Create a bin subdirectory and copy in LSharp.dll and LSharp.Web.dll. Modify your web.config file to include
<httpHandlers>
<add verb=“*” path=“*.lsp” type=“LSharp.Web.LSharpHttpHandler,LSharp.Web”/>
</httpHandlers>
Then write your L Sharp Page as a text file with a .lsp extension. The contents of the file will be passed to the L Sharp evaluator when the page is requested, so it must be a valid L Sharp program. Here is a simple example:
;;; Hello World
(write *response “Hello World”)
As you can see, response is bound to the HttpResponse object. request, session and application are available similarly. In addition, context is bound to the HttpContext. Take a look at the MSDN documentation for System.Web.HttpContext, the object model is fairly self explanatory. Also see the example web site included with the L Sharp source distribution.
A Big Thanks
The thing that most excites me about L Sharp at the moment is the momentum that we seem to be gaining. There is a small but growing number of users, and perhaps more importantly, a growing number of contributors.
L Sharp isn’t my day job, so I can’t always respond quickly to email, but I want to thank everybody who has contacted me. I value all the feedback, comments, patches and words of encouragement – Thanks!
*The opinions expressed on this site are my own and do not necessarily represent those of Two10degrees or Active Web Solutions Ltd.