Of course we know
Defer[Range[20]]
Range[20]
But I try to compress my expression into a string
com = Compress;
SetAttributes[com, HoldAllComplete]
string = com[Range[10]]
1:eJxTTMoPSuNiYGAoZgESPpnFJZ6MQIYhmDQCk8Zg0gRMmoJJMzBpDiYtwKSlJxNIlwEApm8I6w==
I cannot get a unevaluted expression from it?
Defer /@ Uncompress[string]
{1,2,3,4,5,6,7,8,9,10}
Actually the Range[20] is the expected output.How to do this?
myCompress = Function[x, Compress[Unevaluated[x]], HoldAll]; test = cc[Range[10]]; Uncompress[test, Defer]. – J. M.'s missing motivation Apr 10 '17 at 16:55function-construction? – yode Apr 10 '17 at 17:09comwork?" ) Feel free to remove it if you think it's improper. BTW if you're not interested in defining a function for the task, simply useCompress@Unevaluated@Range[20]. – xzczd Apr 10 '17 at 17:19