Emacs 26.1, I try to use function subscr



But I get error:

eval: Symbol’s function definition is void: {a

What language are you trying to use, and where/how are you trying to use it?

If you are trying to evaluate subscr({a,b,c,d,e,f,h},{1,2,3}) as Lisp (which it seems you are) then there are a few things wrong.

  • First, subscr is evaluated as a variable, not a function. If it's not bound as a Lisp variable then you should get an error saying that.

  • Second, the list ({a,b,c,d,e,f,h},{1,2,3}) is evaluated as an application of function {a to a list of arguments. You should get an error saying that {a is not a defined function (which is the error you saw).

  • Third, the rest of that function application - the list of arguments - is illegal Lisp, starting with the use of commas.

In short, this is not Lisp. It's not clear what you're trying to do or in what context you tried to use this text, but it seems that you tried to evaluate at least some of it as Lisp.

A guess is that you wanted to apply a Lisp function called subscr (not a predefined function - where is it defined?) to a string. That would be done like this in Lisp:

(subscr "{a,b,c,d,e,f,h},{1,2,3}")

Or perhaps you wanted to apply subscr to a list of two strings:

(subscr '("{a,b,c,d,e,f,h}" "{1,2,3}"))

In any case, again, function subscr needs to be defined.

  • 1
    I added tag org-mode for you. Your question is quite unclear. I answered it as it was posed. But if you have a questionabout using TBLFM in Org mode, you should pose that separately. Put all of the relevant information in your (new, other) question. Describe the context and just what you've done and what you're trying to do. – Drew Sep 5 '19 at 15:54

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