From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guido Van Hoecke Subject: Re: Using constants in columns Date: Sat, 17 Oct 2015 13:47:06 +0200 Message-ID: References: <877fmmsz49.fsf@ucl.ac.uk> <87vba6voyi.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2503a7ec60105224b7a72 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnPxa-0000Fl-RY for emacs-orgmode@gnu.org; Sat, 17 Oct 2015 07:47:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnPxZ-0005O4-DT for emacs-orgmode@gnu.org; Sat, 17 Oct 2015 07:47:38 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:32838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnPxZ-0005O0-3r for emacs-orgmode@gnu.org; Sat, 17 Oct 2015 07:47:37 -0400 Received: by wijp11 with SMTP id p11so41670296wij.0 for ; Sat, 17 Oct 2015 04:47:36 -0700 (PDT) In-Reply-To: <87vba6voyi.fsf@ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: orgmode , Eric S Fraga --001a11c2503a7ec60105224b7a72 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 16 October 2015 at 16:59, Eric S Fraga wrote: > On Friday, 16 Oct 2015 at 16:38, Guido Van Hoecke wrote: > > Hi Eric, > > > > Thanks for the suggestions, I'll go for the integer value used as an > index > > and please post the index solution for the record? > I have not found a way to specify the vector in a constant. Elisp =E2=80=8B =E2=80=8B =E2=80=8Bneeds arrays with space rather than comma as separator, and I can'= t =E2=80=8B=E2=80=8B find how =E2=80=8Bto specify such arrays as constants. Specifying the vector directly in the formula does work: #+begin_src org | 1 | 0 | 10 | | 2 | 1 | 400 | | 3 | 2 | 9000 | ,#+TBLFM: $3=3D'(* $1 (aref [10 200 3000] $2));N #+end_src That is ok if the vector is only to be used in one single formula. A nicer way is to specify the vector values in named tables and to reference them 'remotely': #+begin_src org ,#+name: v1 |10| ,#+name: v2 |200| ,#+name: v3 |3000| ,#+name: the table to be computed | 5 | v1 | 50 | | 2 | v2 | 400 | | 3 | v3 | 9000 | ,#+TBLFM: $3=3D $1 * remote($2, @1$1);N #+end_src With this solution the values only need to be specified once and can be used where- and whenever needed. --=20 Guido =3D=3D=3D ALL USERS PLEASE NOTE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D A new system, the CIRCULATORY system, has been added. The long-experimental CIRCULATORY system has been released to users. The Lisp Machine uses Type B fluid, the L machine uses Type A fluid. When the switch to Common Lisp occurs both machines will, of course, be Type O. Please check fluid level by using the DIP stick which is located in the back of VMI monitors. Unchecked low fluid levels can cause poor paging performance. --001a11c2503a7ec60105224b7a72 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 1= 6 October 2015 at 16:59, Eric S Fraga <e.fraga@ucl.ac.uk> wr= ote:
On Friday, = 16 Oct 2015 at 16:38, Guido Van Hoecke wrote:
> Hi Eric,
>
> Thanks for the suggestions, I'll go for the integer value used as = an index

and please post the index solution for the record?
<= div>
I have not found a way to specify the vector in a constant.
Eli= sp
=E2=80=8B =E2=80=8B
=E2=80=8Bnee= ds arrays with space rather than comma as separator, and I can't
=E2=80=8B=E2=80=8B
find how
=E2= =80=8Bto specify such arrays as constants.

Specifying the vect= or directly in the formula does work:

#+begin_src org
=C2=A0=C2= =A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1 |=C2=A0=C2=A0=C2=A0=C2=A0 0 |= =C2=A0=C2=A0=C2=A0 10 |
=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 2 |=C2=A0=C2=A0=C2=A0=C2=A0 1 |=C2=A0=C2=A0 400 |
=C2=A0=C2=A0=C2=A0= |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 3 |=C2=A0=C2=A0=C2=A0=C2=A0 2 |=C2=A0 9000= |
=C2=A0 ,#+TBLFM: $3=3D'(* $1 (aref [10 200 3000] $2));N
#+end_= src

That is ok if the vector is only to be used in one single formul= a.

A nicer way is to specify the vector values in named tables and t= o
reference them 'remotely':

#+begin_src org
=C2=A0 ,#= +name: v1
=C2=A0 |10|

=C2=A0 ,#+name: v2
=C2=A0 |200|

= =C2=A0 ,#+name: v3
=C2=A0 |3000|


=C2=A0 ,#+name: the table to= be computed
=C2=A0 | 5 | v1 |=C2=A0=C2=A0 50 |
=C2=A0 | 2 | v2 |=C2= =A0 400 |
=C2=A0 | 3 | v3 | 9000 |
=C2=A0 ,#+TBLFM: $3=3D $1 * remote= ($2, @1$1);N
#+end_src

With this solution the values only need to= be specified once and can
be used where- and whenever needed.

--=
Guido

=3D=3D=3D=C2=A0 ALL USERS PLEASE NOTE=C2=A0 =3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

A new s= ystem, the CIRCULATORY system, has been added.

The long-experimental= CIRCULATORY system has been released to users.=C2=A0 The
Lisp Machine u= ses Type B fluid, the L machine uses Type A fluid.=C2=A0 When the
switch= to Common Lisp occurs both machines will, of course, be Type O.
Please = check fluid level by using the DIP stick which is located in the
back of= VMI monitors.=C2=A0 Unchecked low fluid levels can cause poor paging
pe= rformance.
=C2=A0
--001a11c2503a7ec60105224b7a72--