#1 Extra definitions for an enhanced system

Mark Hurd

extra.lisp is my extension to Rich's base boot.lisp. I
override a couple of his definitions and extend some
others. The important features:

* Reflection

Very useful to navigate around the .NET Framework (and
other classes) without using a class browser.

* P/Invoke

Gives access to the rest of the Win32 API.

* Late binding

Gives access to ActiveX (COM) objects.

* with-dispose

Like lets with each object originally assigned being
disposed, irrespective of what happens to the variable it
is assigned to.

Plus a range of other tools and things I thought I might
use again. There's a lot of useful stuff, some stuff that
ought to be optimised and some that is too specific to
my enmvironment and VB leanings. There's also some
code designed for earlier builds of DotLisp that could be

Documentation is minimal. Leave a note in the forums
here if you can't work out how to use something.


  • Mark Hurd

    Mark Hurd - 2003-07-17

    Extensions to the basic DotLisp

  • Nobody/Anonymous

    Logged In: NO

    Very nice and interesting enhancements.

    Can you give examples with Win32API and ActiveX?


  • Mark Hurd

    Mark Hurd - 2003-10-03

    Logged In: YES

    Hans-Peter: There's a simple FileSystemObject COM example
    in the comments. Here's a contrived COM and Win32API

    I've uploaded my latest version of extra.lisp. Here's a quick
    list of changes:
    - lists as sets use eqv?, not eql?
    - congruent? to compare lists as sets
    - superset & subset -> superset? & subset?
    - intersection simplified
    - uniq bug fix on empty list and reworked
    - set-nth (nth setter) bug fix, off by one error
    - type refection display skips attributes by default
    - event-info to display details about one event
    - type-info displays Sealed/Abstract status (using VB.NET
    - late-set is the setter for late-get
    - pp now prints quotes, backquotes and vectors in their
    reader macro forms
    - (between x lower-bound upper-bound) where _ means
    infinity for upper-bound and negative infinity for lower-bound.
    - @ prnf prf use .NET Framework format strings
    - (edit filename) opens filename in Notepad
    - macroexpand and macroexpand-all extend macroexpand-1
    - enum-matches enumerates over regular expression match
    results (the enum corresponding to for-each-match that was
    already defined)

    There's still much only useful to me and some not generic
    enough yet, but I hope people are finding uses for it and
    ideas from it.

  • Mark Hurd

    Mark Hurd - 2003-10-03

    Updated file with described changes

  • Mark Hurd

    Mark Hurd - 2003-10-03
    • summary: Extra defintions for an enhanced system --> Extra definitions for an enhanced system
  • Mark Hurd

    Mark Hurd - 2003-10-03

    Logged In: YES

    Instead of the intended "contrived COM and Win32API
    example", here's a Win2API sample:

    (PInvoke-declare SendMessage :Lib "User32"
    :Args (vector-of Type.
    IntPtr. Int32. Int32. Int32.)
    :Return-Type Int32.)
    (PInvoke-declare MessageBeep :Lib "user32"
    :Args (vector-of Type.
    :Return-Type Boolean.)
    (PInvoke-declare MessageBox :Lib "user32"
    :Args (vector-of Type.
    IntPtr. String. String. MessageBoxIcon. )
    :Return-Type DialogResult.)
    (PInvoke-declare GetShellWindow :Lib "user32"
    :Return-Type IntPtr.)

    ; Standard message box with beep, but only
    ; "above" the desktop:
    (MessageBeep MessageBoxIcon:Warning)
    (MessageBox (GetShellWindow)
    "Hello, World!\r\n\r\nScreen will blank now."
    "P/Invoke Working..."

    ; On Window 2000 and XP, when you've got
    ; a monitor that can powersave, this instantly
    ; blanks the screen.
    (set HWND_BROADCAST (IntPtr:op_Explicit -1)
    WM_SYSCOMMAND (Int32:Parse "112"
    SC_MONITORPOWER (Int32:Parse "F170"
    nMode 1)
    (dotimes i 1000

    and another COM example:

    (set IEs (create-object "Shell.Application"))
    (set Ws (late Windows IEs))
    (dotimes i (late-get Count Ws)
    (let (W (late Item Ws i))
    (prns (late-get Name W))
    (prns (late-get LocationUrl W))

  • Nobody/Anonymous

    Logged In: NO

    Hello Mark,

    thanks to Southern Australia for sharing the code!

    > .. but I hope people are finding uses for it and ideas from it.

    For me it has yet happend. I hope others will also do.

    When you have other usefull stuff, please post!


  • Mark Hurd

    Mark Hurd - 2005-03-11

    Logged In: YES

    extra.lisp has been added to (and changed a bit) over the last
    18 months. See
    for my latest version.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks