<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.lang.factor.general">
    <title>gmane.comp.lang.factor.general</title>
    <link>http://blog.gmane.org/gmane.comp.lang.factor.general</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6453"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6452"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6451"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6450"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6449"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6448"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6447"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6446"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6445"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6444"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6443"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6442"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6441"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6440"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6439"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6438"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6437"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6436"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6435"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.factor.general/6434"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6453">
    <title>Re: List Comprehension in Factor</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6453</link>
    <description>&lt;pre&gt;Oo, or even

: triples ( n -- seq )
    iota rest 3 [ first3 triple? ] filter-combinations ;


On Mon, May 20, 2013 at 7:06 PM, Alex Vondrak &amp;lt;ajvondrak-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

------------------------------------------------------------------------------
Try New Relic Now &amp;amp; We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, &amp;amp; servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>Alex Vondrak</dc:creator>
    <dc:date>2013-05-21T02:11:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6452">
    <title>Re: List Comprehension in Factor</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6452</link>
    <description>&lt;pre&gt;Or, going by the algorithms in the wiki:

```
USING: arrays kernel locals math math.ranges sequences
sequences.extras ;

:: triples ( n -- seq )
    n [1,b] [| x |
        x n [a,b] [| y |
            y n [a,b]
            [| z | x sq y sq + z sq = ]
            [| z | x y z 3array ]
            filter-map
        ] map concat
    ] map concat ;
```

Fun bug report: using `map-concat` from `sequences.extras` fails to compile
for me---complains about using `call` on a run-time computed value.

But, I really like your approach using `all-combinations`.  It yields a
much nicer-looking version:

```
: triple? ( x y z -- ? )
    [ sq ] tri&amp;lt; at &amp;gt; [ + ] dip = ;

: triples ( n -- seq )
    iota rest 3 all-combinations [ first3 triple? ] filter ;
```

Regards,
--Alex Vondrak



On Mon, May 20, 2013 at 8:18 AM, _ _ &amp;lt;wzrd64-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

------------------------------------------------------------------------------
Try New Relic Now &amp;amp; We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, &amp;amp; servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>Alex Vondrak</dc:creator>
    <dc:date>2013-05-21T02:06:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6451">
    <title>Re: List Comprehension in Factor</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6451</link>
    <description>&lt;pre&gt;! Copyright (C) 2013 Your name.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel sequences math math.functions arrays math.combinatorics ;
IN: pythagorean-triples

: a-b-list ( n -- seq )
    iota rest 2 all-combinations ;

: a-b-c ( seq1 -- seq2 )
    [ first ]
    [ second ]
    [ [ first sq ] [ second sq ] bi + sqrt ]
    tri
    3array ;

: a-b-c-list ( n -- seq )
    a-b-list [ a-b-c ] map ;

: float.0? ( n -- ? )
    dup floor 0 ~ ;

: (pythagoreans) ( n -- seq )
    a-b-c-list [ third float.0? ] filter ;

: pythagoreans ( n -- seq )
    (pythagoreans) [ [ first ] [ second ] [ third &amp;gt;integer ] tri 3array ] map ;

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
&lt;/pre&gt;</description>
    <dc:creator>_ _</dc:creator>
    <dc:date>2013-05-20T15:18:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6450">
    <title>Re: List Comprehension in Factor</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6450</link>
    <description>&lt;pre&gt;We don't have "list comprehensions", per se - but instead have basic map
and filter operations...

Instead of

    [ x for x in range(5) if x % 2 == 0 ]

We would have:

    5 iota [ 2 mod zero? ] filter

Instead of

    [ x ** 3 for x in foo() ]

We would have:

    foo [ 3 ^ ] map

You could use locals if you felt they helped:

    foo [| x | x 3 ^ ] map





On Mon, May 20, 2013 at 5:55 AM, graham telfer &amp;lt;gakousei53-PkbjNfxxIARBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;wrote:

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>John Benediktsson</dc:creator>
    <dc:date>2013-05-20T14:00:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6449">
    <title>List Comprehension in Factor</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6449</link>
    <description>&lt;pre&gt;I was checking out the Rosetta Code site and noticed there is no example of list comprehension in Factor. How can we simulate this convenient tool?

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
&lt;/pre&gt;</description>
    <dc:creator>graham telfer</dc:creator>
    <dc:date>2013-05-20T12:55:28</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6448">
    <title>Re: Code Review: Game of Life</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6448</link>
    <description>&lt;pre&gt;
Some ideas:

1) Your "frequencies" word is the same as "histogram" in math.statistics
vocabulary.

2) Your calculation of neighboring cells could use a constant to represent
the 8  adjacent cells, instead of computing it each time:

CONSTANT: coordinates {
    { 1 1 }
    { 1 0 }
    { 1 -1 }
    { 0 1 }
    { 0 -1 }
    { -1 1 }
    { -1 0 }
    { -1 -1 }
}

: neighbours ( loc -- neighbours )
  coordinates [ v+ ] with map ;

3) you might try factoring out the steps in "steps", perhaps something like
this:

: count-cells ( cells -- counts )
    [ neighbours ] map concat histogram ;

:: live? ( loc count cells -- ? )
    count 3 = [ t ] [ count 2 = loc cells in? ] if ;

:: steps ( cells -- cells' )
    cells count-cells [ cells live? ] assoc-filter keys ;
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>John Benediktsson</dc:creator>
    <dc:date>2013-05-12T17:00:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6447">
    <title>Code Review: Game of Life</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6447</link>
    <description>&lt;pre&gt;Hi there,
I ported a Clojure implementation of Conway's Game of Life to Factor.
Here is the original Clojure version:
http://clj-me.cgrand.net/2011/08/19/conways-game-of-life/
Here is my Factor port: http://paste.factorcode.org/paste?id=2932
How can I make the Factor variant more elegant and/or idiomatic?

Kind Regards,
Kabelo Moiloa
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>kabelo moiloa</dc:creator>
    <dc:date>2013-05-12T16:38:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6446">
    <title>Re: multiple files</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6446</link>
    <description>&lt;pre&gt;
Cheers.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
&lt;/pre&gt;</description>
    <dc:creator>mr w</dc:creator>
    <dc:date>2013-05-12T06:23:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6445">
    <title>Re: multiple files</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6445</link>
    <description>&lt;pre&gt;In the work directory, you can have multiple vocabularies, for example
something like this:

    work/foo/foo.factor
    work/bar/bar.factor
    work/some/other/other.factor

These would correspond to:

    USE: foo
    USE: bar
    USE: some.other

Does that help?


On Sat, May 11, 2013 at 11:19 PM, mr w &amp;lt;wzrd64-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>John Benediktsson</dc:creator>
    <dc:date>2013-05-12T06:21:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6444">
    <title>multiple files</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6444</link>
    <description>&lt;pre&gt;Is it possible to have multiple files in the work directory?

Each file contains words to be attached to the same vocabulary root.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
&lt;/pre&gt;</description>
    <dc:creator>mr w</dc:creator>
    <dc:date>2013-05-12T06:19:11</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6443">
    <title>Re: site down</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6443</link>
    <description>&lt;pre&gt;Looks like it's back now.  I'm guessing it was this:
https://github.com/slavapestov/factor/issues/882


On Fri, May 3, 2013 at 11:35 PM, mr w &amp;lt;wzrd64-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with &amp;lt;2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>Alex Vondrak</dc:creator>
    <dc:date>2013-05-04T15:52:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6442">
    <title>site down</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6442</link>
    <description>&lt;pre&gt;Site down, no posts ... factorcode rapture?

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with &amp;lt;2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
&lt;/pre&gt;</description>
    <dc:creator>mr w</dc:creator>
    <dc:date>2013-05-04T06:35:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6441">
    <title>Re: Confused about run-pipeline</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6441</link>
    <description>&lt;pre&gt;Hi Alex - just saw this. Thanks much; your example unclogs my confusion on
pipes nicely!
Onward ~cw


On Mon, Apr 22, 2013 at 3:06 PM, Alex Vondrak &amp;lt;ajvondrak-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:




&lt;/pre&gt;</description>
    <dc:creator>CW Alston</dc:creator>
    <dc:date>2013-04-25T21:09:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6440">
    <title>Went open source with my GA144 simulator written inFactor</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6440</link>
    <description>&lt;pre&gt;I am happy to say, I went public with the GA144 Simulator, I wrote in Factor.

As you might know the GA144 is a chip containing 144 small computers.  
Invented by Chuck Moore and produced by Greenarrays, Inc. See:  
http://www.greenarraychips.com/

It is a rather big project with the name arrayFactor. The repository  
is at Bitbucket. You can reach it via http://arrayfactor.org

Best regards,
Leon


------------------------------------------------------------------------------
Try New Relic Now &amp;amp; We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, &amp;amp; servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
&lt;/pre&gt;</description>
    <dc:creator>Leon Konings</dc:creator>
    <dc:date>2013-04-23T13:50:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6439">
    <title>Re: Confused about run-pipeline</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6439</link>
    <description>&lt;pre&gt;Well, there's your problem: you don't want `run-pipeline` at all.  :)

  IN: scratchpad "echo \"Hi\"" run-detached my-process set-global
  IN: scratchpad my-process get-global .
  T{ process
      { command "echo \"Hi\"" }
      { environment H{ } }
      { environment-mode +append-environment+ }
      { group +same-group+ }
      { status 0 }
  }

`run-pipeline` is like a series of Unix pipes.  So,

  { "cat log.txt" "grep error" "sort" "uniq" } run-pipeline

is like typing

  $ cat log.txt | grep error | sort | uniq

at a bash prompt.  Except not every element of the pipeline has to be a
process descriptor---you can insert Factor code along the way.

Roughly, it works by sequentially calling `run-pipeline-element` on each
item in your sequence.  `run-pipeline-element` is defined by:

  IN: scratchpad \ run-pipeline-element see-methods
  USING: combinators destructors io io.pipes.private kernel
  quotations ;
  M: callable run-pipeline-element
      [
          [ [ ?reader ] [ ?writer ] bi* ] dip
          [ ( -- result ) call-effect ] curry with-streams*
      ] with-destructors ;

  USING: accessors destructors io.launcher io.pipes.private kernel
  ;
  M: object run-pipeline-element
      [ &amp;gt;process swap &amp;gt;&amp;gt;stdout swap &amp;gt;&amp;gt;stdin run-detached ]
      [ drop [ [ dispose ] when* ] bi&amp;lt; at &amp;gt; ] 3bi wait-for-process ;

I.e., it's already calling `run-detached` on anything in the pipeline
that's just a process description.  Otherwise, it expects a quotation that
takes no inputs, produces one output, and then calls that quotation with
the I/O streams rebound.  E.g.,

  IN: scratchpad { "cat /tmp/patch" [ readln &amp;gt;string ] } run-pipeline .
  {
      0
      "diff --git a/basis/prettyprint/prettyprint-tests.factor
b/basis/prettyprint/prettyprint-tests.factor"
  }

We see that the result of the first item in the pipeline is 0 (the exit
code of cat), and the result of the second item in the pipeline the output
from the Factor quotation, which it read from standard-input.  Except that
standard-input was bound to the output of the prior pipeline element (the
output of cat).

Hope that helps,
--Alex Vondrak
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis &amp;amp; visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>Alex Vondrak</dc:creator>
    <dc:date>2013-04-22T22:06:51</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6438">
    <title>Re: Confused about run-pipeline</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6438</link>
    <description>&lt;pre&gt;Hi -


Yes, indeed, the run-pipeline example works fine, composed

of strings of unix commands. My components are Factor callable

quotations and a launch descriptor:


SYMBOL: my-process

{

  &amp;lt;my-process&amp;gt;                       ! ( -- desc )

  [ run-detached ]                    ! ( -- process )

  [ my-process set-global t ]   ! ( -- t )

}

run-pipeline


Calling run-pipeline on the sequence fails with:


"Error in thread 341 (Future, [ ~slice~ ~quotation~ ~quotation~ dip
run-pipeline-element...):

Data stack underflow"


Note that the phrase "&amp;lt;my-process&amp;gt; run-detached my-process set-global t"

completes successfully in the listener. Also, the code compiles without
error in its

compilation unit.


I can step down through the code as far as the word map! successfully.
However,

trying to set a breakpoint on map! hangs the system, so I can't follow into
that word.

I added the boolean at the end to satisfy the requirement that each
component

must output a single value. I can't see how that alone would produce the
stack

underflow.


Since the vocabulary description for run-pipeline reads:


"Pipeline components must be one of the following:

• A quotation. The quotation is called with both input-stream and
output-stream   rebound, except for the first and last pipeline components,
and it must output a single value.

• A process launch descriptor. See Launch descriptors." ,


I suspect my problem is in the binding of the input/output streams. I'll
experiment

with that, but do let me know if I'm missing something simple. I just want
to find

out how to properly use run-pipeline with ordinary callables, especially
quotations

composed of words with stack effect ( -- ).


Thanks for the replies.

~cw



On Mon, Apr 22, 2013 at 6:20 AM, John Benediktsson &amp;lt;mrjbq7-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:



&lt;/pre&gt;</description>
    <dc:creator>CW Alston</dc:creator>
    <dc:date>2013-04-22T21:42:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6437">
    <title>Re: Idiomatic use of sequences for iterativefunctions?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6437</link>
    <description>&lt;pre&gt;Thank you, John. That's what I was looking for.

I must say: currying an entire sequence is pretty wild! It's a non-obvious
solution.


No, it's not undesirable, except for the fact that 30-40% of that code
exists for the sake of the side-effect.

Of course, computation by calculation is shorter again ...

USING: arrays math math.ranges math.primes.factors sequences ;
IN: lamps

: &amp;lt;people&amp;gt; ( -- seq )
    100 [1,b] &amp;gt;array ;

: calc-switching ( -- lamps )
    &amp;lt;people&amp;gt; [ divisors length even? ] map ;


(But then, that wasn't my purpose. I was trying to figure out how to get a
nested iteration done with sequences instead of always falling back to
recursion.)

Thanks, again.

Loryn Jenkins



On Tue, Apr 23, 2013 at 12:44 AM, John Benediktsson &amp;lt;mrjbq7-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt;wrote:

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis &amp;amp; visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>Loryn Jenkins</dc:creator>
    <dc:date>2013-04-22T15:52:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6436">
    <title>Re: Idiomatic use of sequences for iterativefunctions?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6436</link>
    <description>&lt;pre&gt;Something like this would be simpler:

http://paste.factorcode.org/paste?id=2914#1329

You don't need a symbol to pass the variable around, and even though it is
"side-effecting", I'm not sure that is undesirable here...?


On Mon, Apr 22, 2013 at 7:17 AM, Loryn Jenkins &amp;lt;lorynj-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis &amp;amp; visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>John Benediktsson</dc:creator>
    <dc:date>2013-04-22T14:44:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6435">
    <title>Idiomatic use of sequences for iterative functions?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6435</link>
    <description>&lt;pre&gt;Hi

In "Factor Philosophy", slava writes: "Imperative programming and indexed
loops are almost always not the most idiomatic solution."

I've implemented this puzzle (
http://mindyourdecisions.com/blog/2013/04/22/100-light-bulbs-puzzle/ )
using a side-effecting function: http://paste.factorcode.org/paste?id=2914

The words do-switching and toggle-switches implement the equivalent of a
nested loop.

Without using recursion, counted for loops or side-effecting functions,
what is an idiomatic way of implementing this nested iteration?

Loryn Jenkins
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis &amp;amp; visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>Loryn Jenkins</dc:creator>
    <dc:date>2013-04-22T14:17:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6434">
    <title>Re: Confused about run-pipeline</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6434</link>
    <description>&lt;pre&gt;The example is simple and works fine:

{ "cat log.txt" "grep error" "sort" "uniq" } run-pipeline

Can you explain the more complicated thing you're trying to do?


On Mon, Apr 22, 2013 at 4:30 AM, CW Alston &amp;lt;cwalstonsf-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis &amp;amp; visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>John Benediktsson</dc:creator>
    <dc:date>2013-04-22T13:20:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.factor.general/6433">
    <title>Re: Confused about run-pipeline</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.factor.general/6433</link>
    <description>&lt;pre&gt;i guess you wand to use run-pipeline on factor quotes instead of just unix
commands so you would dispatch to run-pipeline-element on a callable
instead of a "object" which i guess is a string (?)

i would just throw a quote instead of a string into the sequence and it
should just work as long as run-pipeline creates input/outputs for it, your
quotation would though need to read stdin and write stdout i guess so it
would "fit in"


On Mon, Apr 22, 2013 at 1:30 PM, CW Alston &amp;lt;cwalstonsf-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis &amp;amp; visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter_______________________________________________
Factor-talk mailing list
Factor-talk-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/factor-talk
&lt;/pre&gt;</description>
    <dc:creator>Alexander Mueller</dc:creator>
    <dc:date>2013-04-22T13:13:48</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.factor.general">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.factor.general</link>
  </textinput>
</rdf:RDF>
