From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] Some variables with no default value don't provoke an error Date: Thu, 15 Sep 2011 09:26:39 -0600 Message-ID: <87r53hhkff.fsf@gmail.com> References: <80r53jlciw.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:58128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4EFK-0003Bp-MY for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 11:53:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4EFG-0007PH-0a for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 11:53:02 -0400 Received: from mail-gx0-f172.google.com ([209.85.161.172]:57375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4EFF-0007P9-QW for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 11:52:57 -0400 Received: by gxk19 with SMTP id 19so2539780gxk.31 for ; Thu, 15 Sep 2011 08:52:57 -0700 (PDT) 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: Sebastien Vauban Cc: emacs-orgmode@gnu.org "Sebastien Vauban" writes: > Hi Eric, > > As said previously, I've been forced to add a default value to many code > blocks I had in my local LOB, which I ingest in my `.emacs' file: > > #+begin_src emacs-lisp > (when (try-require 'ob-lob) > (org-babel-lob-ingest "~/emacs/site-lisp/my-local-lob.org")) > #+end_src > > Weirdly enough, in the following code block, I must add a default value for > vars `table', `column' and `type' but not for the var `nullability'. > > I've even been able to add fake vars `something' and `else' with no error > being reported (at ingestion time): > > #+srcname: add-column-in-table(table="", column="", something, type="", else, nullability) > #+begin_src sql > -- add column `$column' (if column does not exist yet) > IF NOT EXISTS (SELECT * > FROM INFORMATION_SCHEMA.COLUMNS > WHERE TABLE_NAME = '$table' > AND COLUMN_NAME = '$column') > BEGIN > ALTER TABLE $table > ADD $column $type $nullability > END > #+end_src > > Note that, in the above state, the code block is ingested with no error, but, > if I remove the default value of var `table', it then generates back an > error... > I've just pushed up a check for these functional-syntax variables which will ensure that each is given a default value. Since this check takes place at the location of the code block it /does/ include the name of the code block in the error message. Cheers -- Eric > > Best regards, > Seb -- Eric Schulte http://cs.unm.edu/~eschulte/