Hello!
I'd like to return a sequence of tuples. How do I approach this?
Here's what I tried (and failed) so far:
TUPLE: em id name path ;
C: <em> em
: make-em-all ( -- seq )
{
{ 1 "x" "path" }
{ 2 "y" "math" }
{ 3 "z" "bath" }
} [ <em> ] map ;
The problem here was that <em> expects three items on stack, but receives a
sigle sequence object with three items inside.
I tried to find a way to dump sequence onto the stack, but the following code
failed to even compile due to stack effect reasons:
...
} [ [ dup ] each <em> ] map ;
Any advice? Basically, I wanted to declaratively setup a bunch of objects in
a sort of init-word, put them onto stack as a sequence, and deal with them
interactively afterwards, possibly saving to an Sqlite DB for future use.
---=====---
Александр
------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk