emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Unit test table
@ 2016-02-04 10:48 Eduardo Bellani
  2016-02-06 22:31 ` Aaron Ecay
  0 siblings, 1 reply; 4+ messages in thread
From: Eduardo Bellani @ 2016-02-04 10:48 UTC (permalink / raw)
  To: emacs-orgmode

Hey guys. I've posted this question in the irc-channel, but I had to
leave before I could strike a conversation with the the nice volunteer
who answered my question. I hope that email can preserve the
conversation :)

So, I have a table who's purpose is to demonstrate the working of different
versions of the same code, perhaps in different languages. This is a
working model:

https://gist.github.com/ebellani/7c70d16f06076e4fc375

as you can see, there's repetition and the TBLFM is huge.

Anyone has an idea of a better way to achieve similar results?

Thanks.
-- 
Eduardo Bellani

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Unit test table
  2016-02-04 10:48 Unit test table Eduardo Bellani
@ 2016-02-06 22:31 ` Aaron Ecay
  2016-02-13 19:03   ` Eduardo Bellani
  0 siblings, 1 reply; 4+ messages in thread
From: Aaron Ecay @ 2016-02-06 22:31 UTC (permalink / raw)
  To: Eduardo Bellani, emacs-orgmode

Hi Eduardo,

2016ko otsailak 4an, Eduardo Bellani-ek idatzi zuen:
> 
> Hey guys. I've posted this question in the irc-channel, but I had to
> leave before I could strike a conversation with the the nice volunteer
> who answered my question. I hope that email can preserve the
> conversation :)
> 
> So, I have a table who's purpose is to demonstrate the working of different
> versions of the same code, perhaps in different languages. This is a
> working model:
> 
> https://gist.github.com/ebellani/7c70d16f06076e4fc375
> 
> as you can see, there's repetition and the TBLFM is huge.
> 
> Anyone has an idea of a better way to achieve similar results?

Use babel:

#+name: my-input
| el | value      | expected |
|----+------------+----------|
| 5  | '(5 5 5 5) | 4        |
| ...etc...                  |

#+begin_src elisp :var input=my-input :results table
;; Code that does the calculations in your tblfm line
;; `input' is a variable holding your input table
#+end_src

-- 
Aaron Ecay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Unit test table
  2016-02-06 22:31 ` Aaron Ecay
@ 2016-02-13 19:03   ` Eduardo Bellani
  2016-02-14 14:39     ` Aaron Ecay
  0 siblings, 1 reply; 4+ messages in thread
From: Eduardo Bellani @ 2016-02-13 19:03 UTC (permalink / raw)
  To: Eduardo Bellani, emacs-orgmode

Hey Aaron, thanks for the input.

I don't think that solves my problem. I think I found a solution, but
it involves multiple formulas for the same column.
See here https://gist.github.com/ebellani/d271093faaa943674df6
Does anyone have a better idea for doing something like that? I had to
modify both 'org-table-get-stored-formulas' and
'org-table-fedit-finish' so they stop complaining about multiple
declarations for a single column.

Thanks


On Sat, Feb 6, 2016 at 8:31 PM, Aaron Ecay <aaronecay@gmail.com> wrote:
> Hi Eduardo,
>
> 2016ko otsailak 4an, Eduardo Bellani-ek idatzi zuen:
>>
>> Hey guys. I've posted this question in the irc-channel, but I had to
>> leave before I could strike a conversation with the the nice volunteer
>> who answered my question. I hope that email can preserve the
>> conversation :)
>>
>> So, I have a table who's purpose is to demonstrate the working of different
>> versions of the same code, perhaps in different languages. This is a
>> working model:
>>
>> https://gist.github.com/ebellani/7c70d16f06076e4fc375
>>
>> as you can see, there's repetition and the TBLFM is huge.
>>
>> Anyone has an idea of a better way to achieve similar results?
>
> Use babel:
>
> #+name: my-input
> | el | value      | expected |
> |----+------------+----------|
> | 5  | '(5 5 5 5) | 4        |
> | ...etc...                  |
>
> #+begin_src elisp :var input=my-input :results table
> ;; Code that does the calculations in your tblfm line
> ;; `input' is a variable holding your input table
> #+end_src
>
> --
> Aaron Ecay



-- 
Eduardo Bellani

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Unit test table
  2016-02-13 19:03   ` Eduardo Bellani
@ 2016-02-14 14:39     ` Aaron Ecay
  0 siblings, 0 replies; 4+ messages in thread
From: Aaron Ecay @ 2016-02-14 14:39 UTC (permalink / raw)
  To: Eduardo Bellani, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

Hi Eduardo,

2016ko otsailak 13an, Eduardo Bellani-ek idatzi zuen:
> 
> Hey Aaron, thanks for the input.
> 
> I don't think that solves my problem.

Look at the attached; I think it does what you’re asking for.

Hope this helps,

-- 
Aaron Ecay

[-- Attachment #2: example.org --]
[-- Type: application/vnd.lotus-organizer, Size: 1157 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-14 14:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-04 10:48 Unit test table Eduardo Bellani
2016-02-06 22:31 ` Aaron Ecay
2016-02-13 19:03   ` Eduardo Bellani
2016-02-14 14:39     ` Aaron Ecay

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).