Re: Elisp: Simple function to Add Two Numbers
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Elisp: Simple function to Add Two Numbers         

Group: gnu.emacs.help · Group Profile
Author: Pascal Bourguignon
Date: Aug 27, 2006 14:55

Hadron Quark gmail.com> writes:
> Edward Dodge writes:
>
>> Please,
>>
>> Why do I get "wrong number of arguments" every time I try to run this simple,
>> straight-forward code?
>>
>> (defun ekd-average (jabba wabba)
>> "Adds two numbers and returns the sum."
>> (interactive "nFirstvar: \nn Secondvar: \nr")
>> ( + jabba wabba))
>>
>
> As a fellow beginner I would say its because you havent properly
> specified your second argument string in the interactive
> statement. Check whitespace.

The whitespaces don't matter, as long as they're not just after a
newline. The problem is that there are two newlines with three
characters specifying a total of four interactive arguments: n, n and r.
(r gives two arguments, start and end of region).

--
__Pascal Bourguignon__ http://www.informatimago.com/

READ THIS BEFORE OPENING PACKAGE: According to certain suggested
versions of the Grand Unified Theory, the primary particles
constituting this product may decay to nothingness within the next
four hundred million years.
3 Comments
diggit! del.icio.us! reddit!