From: R. Bharat Rao
Subject: nconc/append argument limit in Lucid Lisp
Date: 
Message-ID: <1992Jan3.231619.571@ux1.cso.uiuc.edu>
Nconc and Append seem to have an argument limit in Lucid Lisp.  Is
there anyway to turn this off?

>(setq j nil)

; set up a list with more than 512 elements.
>(setq ll (dotimes (k 700 j) (push k j)))

> (apply #'nconc ll)
>>Error: NCONC called with 700 arguments, but at most 512 arguments
  are allowed 

Same for append.  

Is there anyway to

I can easily program around it, but surely there is some way to turn
this `feature' off?  (Interestingly mapcar and mapcan don't share this
behavior....).


> (lisp-implementation-version)
"Lucid Common Lisp, Development Environment Version 4.0, 12 November 1990"

Thanks in advance,

Bharat
-- 
R. Bharat Rao                         E-mail: ······@cs.uiuc.edu
[Posting from a group account, while my news feed is down]
Beckman Institute for Advanced Science and Technology
Electrical & Computer Engineering, University of Illinois, Urbana

From: Mark Kantrowitz
Subject: Re: nconc/append argument limit in Lucid Lisp
Date: 
Message-ID: <1992Jan04.224547.81341@cs.cmu.edu>
In article <···················@ux1.cso.uiuc.edu> ······@cs.uiuc.edu writes:
>
>Nconc and Append seem to have an argument limit in Lucid Lisp.  Is
>there anyway to turn this off?

call-arguments-limit is a constant which limits the number of
arguments which may be passed to a function. Note that it is a
constant, so changing its value may not solve your problem.

>I can easily program around it, but surely there is some way to turn
>this `feature' off?  (Interestingly mapcar and mapcan don't share this
>behavior....).

mapcar and mapcan are iteration constructs which apply a function to
every element of a list and cons the results into a list. As such they
are being handed a single argument. Your use of apply with #'nconc,
on the other hand, effectively hands a large number of arguments to
nconc. This use of apply is inefficient and you can probably find a
better and more elegant solution to your problem (e.g., use reduce or
write your own routine).

--mark
From: Jeff Dalton
Subject: Re: nconc/append argument limit in Lucid Lisp
Date: 
Message-ID: <5891@skye.ed.ac.uk>
In article <······················@cs.cmu.edu> ······@cs.cmu.edu (Mark Kantrowitz) writes:
>In article <···················@ux1.cso.uiuc.edu> ······@cs.uiuc.edu writes:
>>
>>Nconc and Append seem to have an argument limit in Lucid Lisp.  Is
>>there anyway to turn this off?
>
>call-arguments-limit is a constant which limits the number of
>arguments which may be passed to a function. Note that it is a
>constant, so changing its value may not solve your problem.

Unfortunately, it's very common for people to be taught to
use such idioms as APPLY of APPEND to flatten a list of lists.
Even Norvig's book includes code of this sort.  I think a useful
step would be to teach different idioms, namely ones based on
REDUCE.

The argument limit isn't a problem introduced by Common Lisp.
Implementations of other dialects of Lisp often had such limitations.
Common Lisp has just made the possibility of a limit explicit and
made it possible to programs to determine what the limit is.

-- jd