Pages as re-usable functions

Hi! :slight_smile:

Following (simplified) Use Case:

I have a page to create all dates between from and to as a row in a table:

These are the calculations:

From and to is converted to a unix stamp:

And the count of days is calculated this way:

At the end, the output is a list of dates:

It’s not about this specific use-case.
Coda allows to write functional, reactive coda with immediate feedback.

It’d be awesome - if this page that I have - if I could use the same functionality in another place, as a function with this signature:

function DatesBetween(from: Date, to: Date): List<Date> {
  // ... coda page

Another good example are more complex FormulaMaps.
There it get’s messy pretty easily, when you require complex logic per iteration, e.g. introducing local constants, nested loops, …

This is already possible with packs :slight_smile: But the comfort barrier to code, build and consume a new pack, compared to write where the cursor already blinks is always a little higher.

A possible example implementation could look like this:

Where all inputs (select, text, … with their according type / generic / metadata) within the blue box are inputs for the function, and all constants are the outputs are exposed via a function.

What do you think?

Thanks! :100: