From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.devel Subject: Re: vectors are something else Date: Mon, 15 Apr 2013 20:28:29 +0800 Message-ID: References: <9D053760-46BC-46F1-B84D-07902E777FF2@bluewin.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1366028917 19361 80.91.229.3 (15 Apr 2013 12:28:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Apr 2013 12:28:37 +0000 (UTC) Cc: guile-devel@gnu.org To: Daniel Llorens Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Apr 15 14:28:41 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1URiWW-0005yP-Id for guile-devel@m.gmane.org; Mon, 15 Apr 2013 14:28:40 +0200 Original-Received: from localhost ([::1]:36631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URiWV-0001Og-Ue for guile-devel@m.gmane.org; Mon, 15 Apr 2013 08:28:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URiWQ-0001Oa-QH for guile-devel@gnu.org; Mon, 15 Apr 2013 08:28:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URiWM-0006Et-3l for guile-devel@gnu.org; Mon, 15 Apr 2013 08:28:34 -0400 Original-Received: from mail-ia0-x22d.google.com ([2607:f8b0:4001:c02::22d]:59445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URiWL-0006Eo-UY for guile-devel@gnu.org; Mon, 15 Apr 2013 08:28:30 -0400 Original-Received: by mail-ia0-f173.google.com with SMTP id j5so3773772iaf.4 for ; Mon, 15 Apr 2013 05:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=mNRVbk5oCWbrY9fqDNqYKCW97IKp07F4oOmRgQyM5yg=; b=Fxnu2QOw4z7aFgdfFXa1YeEJSigW9ObstShEPvcKC/nKJDs5Gx3Sm2q1PJX1P/vtfY qmIZzPUdZ9zcgL8x8tq3zdcNgS4lL75LyfdAZLqRH6WiPLQL7YY4m0gUt+bBJx4diVgi GqzhnRvq+on0jkqK76Khg/b4UrEdX0pl0Zbyf6/Jg3qkpLCGqPqot7pT8lY+gye37Pco SuK6VTwaEj9gts5d3ntJaQ27m2YoG2MBAIWw8WsnOqNzhxgMh5PtTEGEcVgtuU41tJml 7yVuGWyRVtj8AhdDwgQ3WxtOaVwryAyhtcfE/7XOXzMAqZRT0VnwyrSBsfqs695jkkVh UUdw== X-Received: by 10.50.195.134 with SMTP id ie6mr5034792igc.6.1366028909145; Mon, 15 Apr 2013 05:28:29 -0700 (PDT) Original-Received: by 10.64.26.168 with HTTP; Mon, 15 Apr 2013 05:28:29 -0700 (PDT) In-Reply-To: <9D053760-46BC-46F1-B84D-07902E777FF2@bluewin.ch> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c02::22d X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16248 Archived-At: On 15 April 2013 19:29, Daniel Llorens wrote: > > [1] have vector- ops only accept vector- types. =E2=80=A6 > > [2] force all vector objects into arrays. =E2=80=A6 > > For example in [1], you'd prefer vector- to *reject* strided rank-1 array= s > (inc!=3D1), because those require a descriptor and you want to limit your > checks to is-this-scm_tc7_vector. Though such an array is potentially still a vector according to the simple explanation in the manual. So this requires introducing a more complicated discussion of when is an array a vector. And a lot of the uses for treating some arrays as vectors will be lost with this, as it quite restrictive on the layout of the source data. Given the semantic complications and lesser utility, it may as well be that no vectors are arrays and reject all. > On the other hand, in [2], > you want to *accept* offset rank-1 arrays (lbnd!=3D0) because to > reject them you need an explicit check and it's faster to just do > the index computation with this lbnd. > In this case, =E2=80=98vector?=E2=80=99 still must answer #f as the offset = indexing makes the object not a vector. Right? Most non-vector objects passed to =E2=80=98vector-ref=E2=80=99 will throw a= n error, except for offset arrays. Since the result is unspecified aka =E2=80=9Cit = is an error=E2=80=9D, it doesnt have to be correct (ie. include lbnd). Is it really much faster to do one or the other: if lbnd !=3D 0: error index =3D =E2=80=A6 vs: index =3D lbnd + ... ?