Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3319912
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:52:50+00:00 2026-05-17T22:52:50+00:00

The built-in Mathematica command Save[file, symbol] uses FullDefinition[] to look up the definition symbol

  • 0

The built-in Mathematica command Save[file, symbol] uses FullDefinition[] to look up the definition symbol and all of the subsidiary definitions.

For example, the commands

a:=b
c:=2a+b
Save[ToFileName[NotebookDirectory[],"test.dat"],c]

produces the file test.dat containing

c := 2*a + b
a := b

I have a program with a lot of prettifying MakeBoxes type definitions that I do not want to be saved when I Save[] the many separate results.

In terms of the simple example above, I do not want the a := b definition saved to the file. Does anyone know a neat way to make this happen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:52:50+00:00Added an answer on May 17, 2026 at 10:52 pm

    According to the documentation, Save uses FullDefinition while what you want is for it to use Definition. Using a Block we can override the global definition of any symbol, and in particular replace FullDefinition with Definition while running Save:

    Block[{FullDefinition},
      FullDefinition = Definition;
      Save[filename, c]
      ];
    FilePrint[filename]
    DeleteFile[filename]
    

    The magic works:

    c := 2*a + b
    

    EDIT. Wrapping things up with the right attributes:

    SetAttributes[truncatedSave, HoldRest]
    truncatedSave[filename_, args__] := Block[{FullDefinition},
       FullDefinition = Definition;
       Save[filename, args]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, for a built-in function in Mathematica, f, originally f[1] gives {1,2,3}, but
Mathematica's list of built-in formats is pretty extensive; however, JSON is not on that
I built a client server application using an IDL file for client server communication
I was quite surprised that Mathematica does not provide built-in operators to determine whether
Usage Messages of built-in functions have embedded in-line formatting. For example: In[1]:= ActionMenu::usage //
We all know that Mathematica is great, but it also often lacks critical functionality.
What is the best way to define a numerical constant in Mathematica? For example,
Is there a built-in routine for doing numerical integration in Mathematica given two lists
Built a theme in HTML/CSS and customized a the cycle plugin to be a
I built a Testbox to learn something about threading in windows form applications. Silverlight

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.