Gnus development mailing list
 help / color / mirror / Atom feed
* Returning multiple groups from a fancy split
@ 2010-12-21 18:50 Tommy Kelly
  2010-12-21 19:40 ` Tassilo Horn
  2010-12-21 20:53 ` Andreas Schwab
  0 siblings, 2 replies; 5+ messages in thread
From: Tommy Kelly @ 2010-12-21 18:50 UTC (permalink / raw)
  To: ding

I'm looking at one of the call-a-function form of fancy splits, namely:

   (! FUNC SPLIT)

Info says that the argument passed to FUNC will be "the result of
SPLIT". Suppose I have:  

   (! my-function (& "a-group" "another-group))

The result of the inner split there is both groups, right? So in what
form are they returned (and passed)? As a list of two strings, or what? 

Tommy

P.S. Bonus question to help a lisp newb. Is there a simple piece of lisp
I could have written as the body of my-function so as to answer my own
question? 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Returning multiple groups from a fancy split
  2010-12-21 18:50 Returning multiple groups from a fancy split Tommy Kelly
@ 2010-12-21 19:40 ` Tassilo Horn
  2010-12-22  6:52   ` Štěpán Němec
  2010-12-21 20:53 ` Andreas Schwab
  1 sibling, 1 reply; 5+ messages in thread
From: Tassilo Horn @ 2010-12-21 19:40 UTC (permalink / raw)
  To: Tommy Kelly; +Cc: ding

Tommy Kelly <tommy.kelly@verilab.com> writes:

Hi Tommy,

I have no clue about fancy mail splitting anymore (converted to
server-side sieve splitting), so I only take the bonus question.

> P.S. Bonus question to help a lisp newb. Is there a simple piece of
> lisp I could have written as the body of my-function so as to answer
> my own question?

(defun tommy-split-fun (arg)
  (message "SPLIT evaluated to %s" arg))

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Returning multiple groups from a fancy split
  2010-12-21 18:50 Returning multiple groups from a fancy split Tommy Kelly
  2010-12-21 19:40 ` Tassilo Horn
@ 2010-12-21 20:53 ` Andreas Schwab
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2010-12-21 20:53 UTC (permalink / raw)
  To: Tommy Kelly; +Cc: ding

Tommy Kelly <tommy.kelly@verilab.com> writes:

> Info says that the argument passed to FUNC will be "the result of
> SPLIT". Suppose I have:  
>
>    (! my-function (& "a-group" "another-group))
>
> The result of the inner split there is both groups, right? So in what
> form are they returned (and passed)? As a list of two strings, or what? 

Right:

(defun nnmail-split-it (split)
  ;; Return a list of groups matching SPLIT.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Returning multiple groups from a fancy split
  2010-12-21 19:40 ` Tassilo Horn
@ 2010-12-22  6:52   ` Štěpán Němec
  2010-12-22  9:37     ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Štěpán Němec @ 2010-12-22  6:52 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: Tommy Kelly, ding

Tassilo Horn <tassilo@member.fsf.org> writes:

> Tommy Kelly <tommy.kelly@verilab.com> writes:
>
> Hi Tommy,
>
> I have no clue about fancy mail splitting anymore (converted to
> server-side sieve splitting), so I only take the bonus question.
>
>> P.S. Bonus question to help a lisp newb. Is there a simple piece of
>> lisp I could have written as the body of my-function so as to answer
>> my own question?
>
> (defun tommy-split-fun (arg)
>   (message "SPLIT evaluated to %s" arg))

Better use %S instead of %s to e.g. distinguish between symbols and
strings as return values. This also assumes the function receives
exactly one argument; you could use (&rest args) instead of (arg) to get
the list of all arguments received.

  Štěpán



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Returning multiple groups from a fancy split
  2010-12-22  6:52   ` Štěpán Němec
@ 2010-12-22  9:37     ` Andreas Schwab
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2010-12-22  9:37 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: Tassilo Horn, Tommy Kelly, ding

Štěpán Němec <stepnem@gmail.com> writes:

> This also assumes the function receives exactly one argument;

Because that's exactly how it is documented.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-12-22  9:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-21 18:50 Returning multiple groups from a fancy split Tommy Kelly
2010-12-21 19:40 ` Tassilo Horn
2010-12-22  6:52   ` Štěpán Němec
2010-12-22  9:37     ` Andreas Schwab
2010-12-21 20:53 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).