13
$\begingroup$

In version 10.2 LocalSymbol can be used to create a persistent store of a variable. Once this is created I don't see a method to remove it. How are are they removed.

LocalSymbol["MySolution"] = 7

This will create a "MySolution" file in $LocalSymbolBase. All these attempts to remove it fail.

ClearAll[LocalSymbol["MySolution"]]

LocalSymbol["MySolution"] =.

Remove[LocalSymbol["MySolution"]]

DeleteFile[FileNameJoin[{$LocalSymbolBase, "MySolution"}]]

How are these symbols cleaned up? Similarly, how would you clean up a CloudSymbol?

$\endgroup$
2
  • 1
    $\begingroup$ Perhaps DeleteFile[LocalObject["MySolution", $LocalSymbolBase] ? $\endgroup$
    – ilian
    Commented Sep 18, 2015 at 19:28
  • 1
    $\begingroup$ @ilian Yes, that does work. Thanks. Not very intuitive, though. I hope this is added to LocalSymbol's documentation. Or better yet a DeleteLocalSymbol or RemoveLocalSymbol function. $\endgroup$
    – Edmund
    Commented Sep 18, 2015 at 19:51

1 Answer 1

13
$\begingroup$

Cloud symbols are stored in cloud objects (under $CloudSymbolBase) and local symbols are stored in local objects (under $LocalSymbolBase), which can be addressed using CloudObject and LocalObject respectively.

DeleteFile can be used for both cloud and local objects, for example

DeleteFile[CloudObject["MySolution", $CloudSymbolBase]]

DeleteFile[LocalObject["MySolution", $LocalSymbolBase]]
$\endgroup$
3
  • $\begingroup$ Is this bug known to WRI? I received no response when I reported it in July and it still crashes in v10.2 (CASE:3386543). $\endgroup$
    – Szabolcs
    Commented Sep 24, 2015 at 15:15
  • $\begingroup$ @Szabolcs Yes, it is fixed. $\endgroup$
    – ilian
    Commented Sep 24, 2015 at 15:19
  • $\begingroup$ @ilian Oh,you mean that you are a officail-person of wolfram-research?I'm a Chinese user,I want to post a annoy bug that the function of search is so bad in our local version of 10.2,even that I cannon search the MorphologicalTransform in the offical-documentation.And another bug is about the image-tool,it is a good tool to get a mask of pictrue.But it will freezed in evey time I take a draw.Fixed it as soon as,please. $\endgroup$
    – yode
    Commented Sep 24, 2015 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.