Jump to content

Featured Replies

Posted

I've been working in a scratch file, and setting a bunch of variables and defining functions. Now I want to tidy things up by extracting those parts to a separate file. However, because I've evaluated the code, it's all still valid. So I can easily make a new file that doesn't have the necessary definitions.

Is there a way to reset the lisp environment so I can test whether a file works from a clean slate? Obviously I can restart the application entirely - I'm just wondering if there's some way to not do that.


Note: My experiments with built-in GPT are short-lived. Here's a summary of when I inquired with it:

  • Use the clear-all function. This command is not found directly in the documentation you provided, but it is a standard practice mentioned in various OpusModus tutorials and user discussions.

  • The error Undefined operator clear-all arises because clear-all is not a valid or documented function/operator in Opusmodus or Common Lisp. After a thorough search, no built-in Opusmodus function specifically named clear-all was found in the available documentation or function listings.

  • To restart the Lisp session in Opusmodus, the correct approach is to use the “Restart Lisp” command found in the application menu:

    • Menu Path: Tools > Lisp > Restart Lisp

clear-all is not mentioned anywhere in the forum, so I'm not sure how GPT decided it's "standard practice" in user discussions. The "restart lisp" menu command also doesn't exist. So it appears to just be making stuff up.

I have implemented a new utility, 'Snapshot', in the Opusmodus system, which will be released in the next update.

This was not a trivial task as Opusmodus is a complex environment.

Snapshot Utility for Opusmodus

Purpose:

The Snapshot utility offers a lightweight, reversible checkpoint for interactive development.  It captures the state of a single package—every function, macro, variable, and class definition—so that experimental changes can be discarded without restarting Opusmodus.

Make Snapshot:

Tools ▸ Snapshot ▸ Make Snapshot

Records the current symbol table of the OM package.

Clear Snapshot:

Tools ▸ Snapshot ▸ Clear Snapshot

Deletes every definition added or altered since the snapshot and restores anything overwritten.

Typical Workflow:

'Make Snapshot' to capture a clean baseline.

Prototype new forms in the Listener or a scratch buffer.

Test the experimental code.

If the code works, move the validated definitions into a file under ~/Opusmodus/User Source/Extensions/, evaluate the file, and continue. If not, invoke 'Clear Snapshot' to return the environment to its baseline.

I hope some of you will appreciate this new feature in your own development work.

Create an account or sign in to comment


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy