Re: [Scheme-reports] Appeal for review help with R7RS draft 4 Denis Washington (15 Oct 2011 07:14 UTC)
Re: [Scheme-reports] Appeal for review help with R7RS draft 4 Jeronimo Pellegrini (15 Oct 2011 12:06 UTC)
Re: Appeal for review help with R7RS draft 4 Arthur A. Gleckler (16 Oct 2011 04:46 UTC)
Re: Appeal for review help with R7RS draft 4 Arthur A. Gleckler (16 Oct 2011 21:08 UTC)
Re: Appeal for review help with R7RS draft 4 Arthur A. Gleckler (17 Oct 2011 06:27 UTC)
[Scheme-reports] Legacy caar to cddddr Jussi Piitulainen (16 Oct 2011 14:45 UTC)
Re: [Scheme-reports] Legacy caar to cddddr John Cowan (17 Oct 2011 06:41 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Alex Shinn (17 Oct 2011 23:39 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Jussi Piitulainen (20 Oct 2011 12:12 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Ray Dillinger (25 Oct 2011 00:43 UTC)
Re: [Scheme-reports] Legacy caar to cddddr John Cowan (25 Oct 2011 02:17 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Alex Shinn (20 Oct 2011 08:21 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Ray Dillinger (20 Oct 2011 17:06 UTC)
Re: [Scheme-reports] Legacy caar to cddddr John Cowan (20 Oct 2011 17:46 UTC)
Re: Legacy caar to cddddr Arthur A. Gleckler (20 Oct 2011 17:50 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Aubrey Jaffer (20 Oct 2011 20:18 UTC)
Re: [Scheme-reports] Legacy caar to cddddr John Cowan (20 Oct 2011 22:44 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Alex Shinn (21 Oct 2011 02:48 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Aubrey Jaffer (22 Oct 2011 00:04 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Alex Shinn (23 Oct 2011 05:27 UTC)
Re: [Scheme-reports] Legacy caar to cddddr John Cowan (20 Oct 2011 17:52 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Grant Rettke (21 Oct 2011 02:34 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Alex Shinn (21 Oct 2011 02:51 UTC)
Re: [Scheme-reports] Legacy caar to cddddr John Cowan (21 Oct 2011 02:56 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Grant Rettke (21 Oct 2011 20:16 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Aubrey Jaffer (22 Oct 2011 00:14 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Andre van Tonder (22 Oct 2011 14:47 UTC)
Re: [Scheme-reports] Legacy caar to cddddr John Cowan (22 Oct 2011 17:56 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Andre van Tonder (22 Oct 2011 19:15 UTC)
Re: [Scheme-reports] Legacy caar to cddddr John Cowan (22 Oct 2011 20:31 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Andre van Tonder (23 Oct 2011 08:11 UTC)
Re: [Scheme-reports] Legacy caar to cddddr John Cowan (23 Oct 2011 19:41 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Denis Washington (22 Oct 2011 19:16 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Aubrey Jaffer (24 Oct 2011 00:57 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Alex Shinn (23 Oct 2011 05:39 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Andre van Tonder (23 Oct 2011 08:04 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Jussi Piitulainen (23 Oct 2011 11:44 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Alex Shinn (23 Oct 2011 15:16 UTC)
Re: [Scheme-reports] Legacy caar to cddddr Andre van Tonder (23 Oct 2011 16:27 UTC)
Re: [Scheme-reports] Legacy caar to cddddr John Cowan (23 Oct 2011 18:14 UTC)

Re: [Scheme-reports] Legacy caar to cddddr Alex Shinn 23 Oct 2011 05:26 UTC

On Sat, Oct 22, 2011 at 9:03 AM, Aubrey Jaffer <agj@alum.mit.edu> wrote:
>
> But those aren't how JACAL uses pairs.  It would be something like:
>
>  (define poly:var car)
>  (define bunch:first car)
>  (define poly:coefficients cdr)
>  (define poly:constant-term cadr)
>  (define poly:linear-coefficient caddr)
>  (define poly:non-constant-coefficients cddr)
>
> Notice that we are already into the third level with CADDR.  These
> accessor names do not cover all the ways in C*R they can be used.
> CAR is also the constant in a coefficient list, or the first
> coefficient in the CDR of a coefficient list...

OK, so your polynomial is a variable plus an
ordered list of coefficients.

> CONS can be used to attach a variable to a list of coefficients, to
> raise the variable exponent by 1 on all terms in a coefficient list,
> to add an element to the front of a "bunch" (which serve as
> mathematical vectors)...  Multiple versions of MAP would be needed.

I never said you shouldn't use lists, and it sounds
like they're doing a good job here.

> I don't find your name in any JACAL correspondence or ChangeLog.  Have
> you actually looked at JACAL source?  Its unfair to declare my code
> illegible without having made a serious examination of it.

No, I would probably find the JACAL source unintelligible.
However, if you just used two accessors:

  (define make-poly cons)
  (define poly:var car)
  (define poly:coefficients cdr)

then the code would make a lot more sense.  The uses of caddr
which you referred to become:

  (cadr (poly:coefficients x))

or more likely

  (cadr coeffs)

if the coefficients are already bound in the same scope.  You
no longer have any accessors beyond depth two.  Although
in this case using `second' instead of `cadr' is probably clearer.
And `caddr' is just `third' anyway, which I acknowledged was
useful.

--
Alex

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports