What is the idiomatic way to call a function with many arguments?

In Lisp (any Lisp dialect will do), what is the idiomatic way to call a function with many arguments?

To many, I mean exceeding the 80-digit limit.

Let's say we have an example function with a name foo-functhat takes a variable number of arguments

(foo-func 'foo 'bar 'baz 'qux 'foo-bar 'foo-baz 'foo-qux 'bar-foo 'bar-baz 'you-get-the-idea)

How can you usually arrange arguments, if not on a long incomprehensible line?

NOTE , this is not a question of personal preference, of how he recommended it.

+4
source share
1 answer

It will usually be aligned as follows:

(foo-func 'foo
          'bar
          'baz
          'qux
          'foo-bar
          'foo-baz
          'foo-qux
          'bar-foo
          'bar-baz
          'you-get-the-idea)

, :

(foo-func 'foo
          'bar
          'baz
          'qux
          'foo-bar 'foo-baz 'foo-qux
          'bar-foo 'bar-baz
          'you-get-the-idea)

:

(foo-func 'foo
          'bar
          'baz
          'qux
          :barista 'foo-bar
          :bazaar 'foo-baz
          :quxfrog 'foo-qux
          :baroofa 'bar-foo
          :barazza 'bar-baz
          :say-what 'you-get-the-idea)

:

(foo-func 'foo 'bar 'baz 'qux
          :barista 'foo-bar
          :bazaar 'foo-baz
          :quxfrog 'foo-qux
          :baroofa 'bar-foo
          :barazza 'bar-baz
          :say-what 'you-get-the-idea)
+7

All Articles