unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: anonymous <savannah-bounces@gnu.org>
Subject: [bug #12994] Bug in guile's array-map! transforming single array
Date: Thu, 5 May 2005 20:40:33 +0000	[thread overview]
Message-ID: <20050505-164033.sv0.19870@savannah.gnu.org> (raw)
In-Reply-To: 


URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=12994>

                 Summary: Bug in guile's array-map! transforming single array
                 Project: Guile
            Submitted by: None
            Submitted on: Thu 05/05/2005 at 16:40
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open

    _______________________________________________________

Details:

Hello,

I have been using Guile with Cygwin for a while, and with pleasure; recently
I tried upgrading from version 1.6.4 to 1.6.5,
but with the new version some of my scripts do not work any more.
The problem appears to be with array-map!.
When I apply it to a single array to do a simple calculation,
it complains that "At least one source array is required.",
for instance, when I do
  (define a #(1 2 3 4 5 6))
  (define (sqr x) (* x x))
  (array-map! a sqr a)
I used to get (in Guile 1.6.4):
  1 4 9 16 25 36
but in Guile 1.6.5 it no longer works, I get the error message.
The cause of this seems to be a change in ./libguile/ramap.c;
The first few lines used to read:
  {
    SCM_VALIDATE_PROC (2,proc);
    SCM_VALIDATE_REST_ARGUMENT (lra);
    switch (SCM_TYP7 (proc))
But in 1.6.5, this has been changed to:
  {
    SCM_VALIDATE_PROC (2,proc);

    if (!(SCM_CONSP (sources) && SCM_CONSP (SCM_CDR (sources))))
      {
        SCM_MISC_ERROR ("At least one source array is required.", SCM_EOL);
      }

    switch (SCM_TYP7 (proc))
Why is this?  Surely the invocation with a single array 
was a useful thing to be able to do?  
Is there a deeper reason for the second SCM_CONSP?  Or can we get rid of it?

Best regards,
Mischa







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=12994>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


             reply	other threads:[~2005-05-05 20:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-05 20:40 anonymous [this message]
2005-05-09  0:03 ` [bug #12994] Bug in guile's array-map! transforming single array Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050505-164033.sv0.19870@savannah.gnu.org \
    --to=savannah-bounces@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).