help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Elisp: Simple function to Add Two Numbers


From: Pascal Bourguignon
Subject: Re: Elisp: Simple function to Add Two Numbers
Date: Sun, 27 Aug 2006 23:55:40 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Hadron Quark <hadronquark@gmail.com> writes:

> Edward Dodge <user@foo.bar> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]