<?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://comments.gmane.org/gmane.comp.lang.factor.general/5823"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5822"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5817"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5815"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5812"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5810"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5808"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5802"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5797"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5794"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5790"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5777"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5774"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5772"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5770"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5769"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5766"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5765"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5762"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.factor.general/5758"/>
      </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://comments.gmane.org/gmane.comp.lang.factor.general/5823">
    <title>Strings &amp; co.</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5823</link>
    <description>&lt;pre&gt;Hi there,

I sometimes ponder the difference between " and everything else, regarding whitespace after the word. It's particularly disconcerting when using parsing words like R", which do require the space.

Since in the standard library there are only 6 words containing ", I propose the following parsing change: Treat " as end of word. This would generalise quotes so that we can write R".*", which to me is a lot less confusing than R" .*".

I don't believe anyone would write a word named R"blah", because of how confusing that looks.

Would this be worth implementing?

Luke
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
&lt;/pre&gt;</description>
    <dc:creator>Luke Worth</dc:creator>
    <dc:date>2012-05-23T22:20:22</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5822">
    <title>build farm down?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5822</link>
    <description>&lt;pre&gt;As the title says. I've just tried to find something on the irc logs but
I'm too brain-fried at the moment (my office is at 31 °C). Is the
continuous integration thing unmaintained or am I missing something?

Cheers,

Ben
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
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>Ben Schlingelhof</dc:creator>
    <dc:date>2012-05-23T09:41:27</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5817">
    <title>format-float and locale decimal point</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5817</link>
    <description>&lt;pre&gt;Hi list,
using a french locale (fr_FR.UTF-8) breaks printing of floats:
IN: scratchpad 3.5 .
3,5.0

This is because the decimal point in french is ",", so the output of
(format-float) is "3,5" and fix-float explicitly checks for "."
The locale is forced by gtk to the environnement variables. However,
the old X11 backend also forced the locale (in basis/x11/x11.factor)
so this is should not be new with the gtk backend..

So I guess the best solution is to force LC_NUMERIC to a locale that
has a "." as the numeric separator right after gtk_init (for example
set_locale LC_NUMERIC "C").
Here's a patch that does that: http://paste.factorcode.org/paste?id=2595

Please feel free to modify/improve the patch...
Jon

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
&lt;/pre&gt;</description>
    <dc:creator>Jon Harper</dc:creator>
    <dc:date>2012-05-20T15:24:06</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5815">
    <title>couchDB HTTP I/O problem</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5815</link>
    <description>&lt;pre&gt;Greetings, Factoristas -


I'm looking for advice/insight on an io timeout error problem. I've built a
couchdb 1.2.0 database,

and sucessfully replicated it via curl (command line) back &amp;amp; forth between
my localhost cdb instance

and Cloudant and Iriscouch hosts. But when I try to POST a _replicate
command from Factor, I've found

no way to avoid an immediate closed connection and retry (terminal msg),
followed by an I/O

timeout error (listener). Looks like this:


! sample Factor code;  starred* words just alternates of couchdb vocab
(except set-keep-alive*)

: set-keep-alive* ( request -- request )  ! pipeline fiddling with headers

     "keep-alive" "connection" set-header

     "cwalston" "password" set-basic-auth  ;


: couch-http-request* ( request -- data )

    set-keep-alive*  ! ( -- request )

dup .                        ! test display (see below)

    [ http-request ] [

        dup download-failed? [

            response&amp;gt;&amp;gt; body&amp;gt;&amp;gt; json&amp;gt; &amp;lt;couchdb-error&amp;gt; throw

        ] [

            rethrow

        ] if

    ] recover nip ;


: couch-request* ( request -- assoc )

    couch-http-request* json&amp;gt; ;


: couch-post* ( post-data url -- assoc )

    &amp;lt;post-request&amp;gt; couch-request* ;


: localhost&amp;gt;cloudant ( -- assoc )

     H{

         { "source" "http://localhost:5984/tcm-herbarium" }

         { "target" "http://cwalston:password-uEWqhUeqGTRWk0Htik3J/w&amp;lt; at &amp;gt;public.gmane.org/tcm-herbarium" }

     } &amp;lt;json-post-data&amp;gt;  ! ( -- post-data )

"http://localhost:5984/_replicate"

       couch-post* ;


! attempt  a POST...

IN: scratchpad localhost&amp;gt;cloudant

T{ request

    { method "POST" }

    { url URL" http://localhost:5984/_replicate" }

    { version "1.1" }

    { header

        H{

            { "user-agent" "Factor http.client" }

            { "connection" "keep-alive" }

            {

                "Authorization"

                "Basic Y3dhbHN0b246b21haGFuYg=="

            }

        }

    }

    { post-data

        T{ post-data

            { data

                B{

                    123 34 115 111 117 114 99 101 34 58 34 104

                    116 116 112 58 47 47 108 111 99 97 108 104

                    111 115 116 58 53 57 56 52 47 116 99 109 45

                    104 101 114 98 97 114 105 117 109 34 44 34

                    116 97 114 103 101 116 34 58 34 104 116 116

                    112 58 47 47 99 119 97 108 115 116 111 110

                    58 111 109 97 104 97 110 98 64 99 108 111

                    117 100 97 110 116 46 99 111 109 47 116 99

                    109 45 104 ~10 more~

                }

            }

            { content-type "application/json" }

        }

    }

    { cookies V{ } }

    { redirects 10 }

}


IN: scratchpad


--- Data stack:

H{ { "error" "timeout" } }


== Call stack traceback; Can't pin down the timeout source -- port,
duplex-stream, encoder, decoder, …?

(U) Quotation: [ set-namestack init-catchstack self quot&amp;gt;&amp;gt; call -&amp;gt; stop ]

(O) Word: listener-thread

(O) Word: listener

(O) Word: (listener)

(U) Quotation: [

        [ ~quotation~ dip swap ~quotation~ dip ] dip swap

        [ call datastack ] dip -&amp;gt; swap [ set-datastack ] dip

    ]

(U) Quotation: [ call -&amp;gt; datastack ]

(O) Word: couch-request*

(O) Word: couch-http-request*

(O) Word: http-request

(O) Word: ( gensym )

(O) Method: M\ input-port stream-read-partial-unsafe

(O) Method: M\ unix (wait-to-read)

(O) Word: wait-for-port

(O) Word: wait-for-fd

(O) Word: io-timeout

(O) Method: M\ object throw

(U) Quotation: [

        OBJ-CURRENT-THREAD special-object error-thread set-global

        continuation -&amp;gt; error-continuation set-global

        [ original-error set-global ] [ rethrow ] bi

    ]

====================


! ===  before the listener returns, I get the following terminal response:

[info] [&amp;lt;0.13740.0&amp;gt;] Retrying HEAD request to https://cwalston:*****&amp;lt; at &amp;gt;
cloudant.com:443/tcm-herbarium/ in 0.25 seconds due to error
connection_closing

[info] [&amp;lt;0.13637.0&amp;gt;] 127.0.0.1 - - POST /_replicate 500

[error] [&amp;lt;0.13741.0&amp;gt;] ** Generic server &amp;lt;0.13741.0&amp;gt; terminating

** Last message in was {'EXIT',&amp;lt;0.13740.0&amp;gt;,killed}

** When Server state == {state,"http://localhost:5984/tcm-herbarium/",20,[],

                               [],

                               {[],[]}}

** Reason for termination ==

** killed

=ERROR REPORT==== 25-Apr-2012::22:12:07 ===

** Generic server &amp;lt;0.13741.0&amp;gt; terminating

** Last message in was {'EXIT',&amp;lt;0.13740.0&amp;gt;,killed} …etc


====================


So, folks -- don't know If anyone is coding against the couchdb vocab in
particular, but any

general remarks on handling HTTP connections &amp;amp; I/O timeouts would be a boon.


Thanks in advance,

Charles Alston


&lt;/pre&gt;</description>
    <dc:creator>CW Alston</dc:creator>
    <dc:date>2012-04-26T06:38:39</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5812">
    <title>Is Development Dead?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5812</link>
    <description>&lt;pre&gt;
Hi,

It is some time since I checked out the Factor site but I wanted to see if there was an update to version 0.94. There was no change. I checked out the blogs from Planet.Factor and noticed that all but 1 seemed to have no additions for about a year. It prompts me to ask if Factor is dead and if there will ever be a version 1?
       ------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2_______________________________________________
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>graham telfer</dc:creator>
    <dc:date>2012-04-15T03:13:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5810">
    <title>Plotting</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5810</link>
    <description>&lt;pre&gt;Hello,

Is there a library for plotting a dataset on a graph?
If not, I'm inclined towards producing one.

Luke

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
&lt;/pre&gt;</description>
    <dc:creator>Luke Worth</dc:creator>
    <dc:date>2012-03-20T23:25:29</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5808">
    <title>IDE news</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5808</link>
    <description>&lt;pre&gt;Hi to all,
If someone doesn't feel comfortable with emacs....
exists an editor that support factor syntax coloring, code folding,
source tree and basic code completion.
I use it regulary for factor and for many others programming languages.
I really suggest to give it a try, just download the latest beta.

http://www.uvviewsoft.com/synwrite &amp;lt;http://www.uvviewsoft.com/synwrite/&amp;gt;

michele pes

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure_______________________________________________
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>Michele Pes</dc:creator>
    <dc:date>2012-03-15T09:24:19</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5802">
    <title>Beginner question about style and stack shuffling</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5802</link>
    <description>&lt;pre&gt;Dear all,

I am starting to learn Factor as my first concatenative language (from
a FP background) and enjoy it very much.

However, when trying to write simple words I get stuck on how to best
express dataflow.

As a (very very simple) example, I am trying to write a word

: swap-element ( i1 array1 i2 array2 -- )

that swaps two elements with indices i1 and i2 from 2 (aliased or not) arrays.

It is very easy to write such a word using lexical variables.

However, I have two problems with that:
 - I am not sure it is the right tool to use or just my brain bringing
me back to what I know.
 - It does not show the symmetries of the dataflow of this word

I quite like the style of something along the lines of:

: swap-element ( i1 array1 i2 array2 -- )
  [  [ nth  ] 2keep  ] 2bi&amp;lt; at &amp;gt; ???? [ set-nth ] 2 smart-apply ;

because it shows the dataflow better than with lexical variables.

But I can't find something nice to put instead of ????.

So, I guess that my question is: how to solve this problem and, more
importantly, how to learn to
solve this kind of problem by myself?

Thank you very much for your help,

Best regards,

Nicolas.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
&lt;/pre&gt;</description>
    <dc:creator>nicolas.oury-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2012-03-12T13:00:34</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5797">
    <title>Learning Factor - string,array and io handling - beginner</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5797</link>
    <description>&lt;pre&gt;I solved Windows-specific installation issues I had with Factor, and now I
have moved on to playing with Factor. I thought I would best learn it by
trying to accomplish a work-related task with it instead of just trying to
rewrite some previous python code. Anyway, I have a CSV formatted file that
has been exported from an Excel file. The original Excel sheet was laid out
like a horizontal form, so there is no easy relationship between headers
and rows. Please forgive me, and tell me if I should put the code or file
snippet elsewhere, and I will do so in future posts.

Here is a sample of the CSV output:

"Show Report",,,,
I simply wanted the value right after Show Date: 24/02/2012, Ticket issued:
1029 and Total Attendance 998, like so: 24/02/2012,1029,998
I don't need headers.
Here is the code I have been using in the listener:

USING: io.encodings.ascii io.encodings.utf8 regexp csv
 This gets me 95% of the way there, but it is surely not the cleanest or
Factor-like way to go. Here's the file contents results:



Using a series of cuts could get me there, but is very inefficient. I tried
other regexp like re-split on comma and re-replace with blanks, but these
threw errors, or returned with no effect.

Any tips on other functions or structures would be most appreciated. I
tried slice, joins, the CSV library,and some others, but mainly received
errors asking for a string, when the Inspector showed that I had a string
on the top of the stack. How can I index the string like: string[0] or
string[2:4]? Or some other way of achieving the end results?

Thanks. I hope the post is not too long...

Rob
------------------------------------------------------------------------------
Virtualization &amp;amp; Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/_______________________________________________
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>Robert Herman</dc:creator>
    <dc:date>2012-03-10T12:44:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5794">
    <title>Crashes in Win32</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5794</link>
    <description>&lt;pre&gt;I have been trying to use the Win32 build of Factor,
factor-winnt-x86-32.0.94.  When simply scrolling through content displayed
on browser windows (created by pressing both the Help button on the
Listener window and invoking the browser-window word) Factor will crash:
 all of the windows disappear and everything's gone.

I have confirmed this on two different Windows XP machines (both on SP3.)

Wish I could give you more information, but that is all I see thus far.
 And this behavior is not consistent, not as far as I can tell.

Is this a known problem with the 32-bit Windows flavors of the Factor
binaries?

I confess disappointment:  I was getting ready to start back in on trying
to use furnace, etc, and now the latest stable build for Win32 is
unreliable, right on the heels of my personal progress in understanding
functional programming well enough to want to give Factor a try again.
 Please don't tell me that I shall have to confine myself to Haskell when I
want to do some elegant functional programming...

Thanks in advance for any help, suggestions.

Richard Stewart
------------------------------------------------------------------------------
Virtualization &amp;amp; Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/_______________________________________________
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>Richard Stewart</dc:creator>
    <dc:date>2012-03-08T21:25:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5790">
    <title>stack effect</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5790</link>
    <description>&lt;pre&gt;Hi!
Today I was trying to write some factor code and it turned out that I can
write such code:
*1 5 4 3 2 [ 5 = not ] loop*
It works and produces stack with one element 1. I expect that at least I
would have a warning because loop word takes quotation with ( ... -- ... ?
) stack effect. In the example I use quotation with ( x -- x ) stack
effect. So what I am missing?

Cheers,
   Arkady Rost
------------------------------------------------------------------------------
Virtualization &amp;amp; Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/_______________________________________________
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>Arkady Rost</dc:creator>
    <dc:date>2012-03-02T21:32:20</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5777">
    <title>Trying factor</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5777</link>
    <description>&lt;pre&gt;Hi everyone. I'm currently deeply fascinated by lisp and forth for some reason, and with Joy being at risk, I decided to take a dab at factor.

I downloaded the source during the weekend from git and used the build-support/factor.sh update, which went just fine on my x86_64 debian-unstable box.

However I cannot run the bunny and terrain examples. They fail with a segfault:

Memory protection fault at address 7f2adb2b90b0

I'm just trying them at work here and I have the same issue, so maybe there is a problem with the examples themselves?

Bests.


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
&lt;/pre&gt;</description>
    <dc:creator>Yuri D'Elia</dc:creator>
    <dc:date>2012-02-20T14:49:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5774">
    <title>Teaching myself Factor - code review, please?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5774</link>
    <description>&lt;pre&gt;(this is a resend of a message that got caught in the moderation queue)

I have a friend who occasionally runs programming competitions for kids,
and when he's putting together exercises he sometimes runs them by us
just to see what we'll come up with. The other day he posted
a description of a simple task and I thought I'd have a go. I got it
working in Python very neatly, but then I decided I'd see if I could
figure out how to do the same in Factor.

Here's the problem description:

    Code Golf Challenge #1
    ======================

    Write something that will:

    * Encode stdin into chunks like so:
01      1 octet         SOH
xxxx    2 octets        chunk number (monotonically increasing)
xx      1 octet         chunk length
...     &amp;lt;256 octets     up to 255 bytes of data
xx      1 octet         checksum (8-bit sum of all data bytes)
      
      with an "end of transmission" marker of:
04      1 octet         EOT
xxxx    2 octets        chunk number
00      1 octet         length 0

    * optionally shuffle chunks
    * base64-encode output

    Your entry should be *readable*.  Use any standard libraries you want.

    Par 78 SLOC (ANSI C).  It relies on standard Unix tools and pipes.

For what it's worth, I'm told this algorithm is very similar to the
ancient XMODEM file-transfer protocol.  Yes, 'readable' conflicts with
'code golf'; at least for the Factor version I'm trying to prefer
readability over brevity. Also, comparing my implementation to the
sample ANSI C implementation, it turns out there are extra rules:

    - chunk length is actually capped at 128 bytes
    - the uint16 chunk length should be stored in big-endian order

Here's my Factor implementation. It works (that is, it produces
identical output to the reference implementation), but it's not very
pretty (note that I've ignored the 'shuffle' feature, and base64
encoding is done with an external tool, same as the reference
implementation):

    USING: arrays io io.encodings io.encodings.binary kernel locals
make math pack sequences syntax ;
    IN: bmodem

    CONSTANT: WINDOW 128

    ! Splits stdin into an array of WINDOW-sized byte-arrays.
    : read-chunks ( -- seq )
[ [ WINDOW read dup f = [ ] [ , t ] if ] loop ] { } make
;

    ! Takes a sequence of payload byte-arrays and frames each one
    ! with a packet-header and check-sum.
    ! Also adds the trailer ("EOT") packet.
    : format-packets ( seq -- seq' )
[
    [
[| payload index |
    1 index payload length 3array "CSC" pack-be %
    payload %
    payload sum 256 mod ,
] B{ } make
    ] map-index
]
[ length 4 swap 0 3array "CSC" pack-be ] bi
suffix
;

    ! Slurp bytes from stdin, spit packets to stdout.
    : main ( -- )
binary decode-input read-chunks 
binary encode-output format-packets [ write ] each
;

    MAIN: main

In particular, the way read-chunks breaks out of the loop when it's hit
EOF strikes me as ugly, what with the if word's quotations having
different stack signatures. Also, there's still a few stack-shuffling
words lurking about in there. I'm not sure if that's within standard
tolerances, or if I'm doing something wrong.

Any hints or suggestions?

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
&lt;/pre&gt;</description>
    <dc:creator>Tim Allen</dc:creator>
    <dc:date>2012-02-20T12:59:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5772">
    <title>Declarative-style code</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5772</link>
    <description>&lt;pre&gt;Hi, 

As a long time Haskell fan, I've often wanted to write simple declarative code but found this a little too verbose in Factor. e.g. Here is my price calculations for a wedding reception:

: receptionPerHead ( -- price ) 60 ;
: receptionAttendants ( -- price ) 50 ;
: reception ( -- price ) receptionPerHead receptionAttendants * ;
: venueHire ( -- price ) 2800 ;
: total ( -- price ) [ venueHire , reception , ] { } make sum ;

Extrapolate this to about 5x the size and you have my actual wedding budget. I think this contains too much programming stuff, making it hard to read compared to the Haskell version:

receptionPerHead = 60
receptionAttendants = 50
reception = receptionPerHead * receptionAttendants
venueHire = 2800
total = sum [venueHire, reception]

So what I did was make:

SYNTAX: D:
    CREATE-WORD
    parse-definition
    (( -- x ))
    define-declared ;

so the factor code now looks like:

D: receptionPerHead 60 ;
D: receptionAttendants 50 ;
D: reception receptionPerHead receptionAttendants * ;
D: venueHire 2800 ;
D: total [ venueHire , reception , ] { } make sum ;

I like this better but the total still doesn't read quite nicely. I'd prefer something like

{ venueHire reception } sum

... but that seems like I'd have to write special syntax to evaluate the words in the literal.

My questions are:
Is what I'm doing idiomatic Factor?
Is there a better, completely different way of doing all of this (i.e. using Factor like a spreadsheet)?
Is there a way of defining constants so they are substituted at parse-time?

Thankyou,
Luke------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2_______________________________________________
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>Luke Worth</dc:creator>
    <dc:date>2012-02-20T12:19:24</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5770">
    <title>What's with the moderation queue?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5770</link>
    <description>&lt;pre&gt;A while ago I sent a message to the list, except it turns out that
I'd subscribed to the list from a different email address than
I currently use as my default, and messages from non-subscribed
addresses get held for moderation.

I immediately unsubscribed with my old address and resubscribed with my
new address, but that obviously wasn't enough to unblock my message
stuck in the moderation queue. I figured in a few days the list
moderator would get around to cleaning out the queue, and my question
would get an answer, but it's been a couple of weeks now, and I haven't
heard anything.

Perhaps somebody out there with moderator permissions could give the
queue a nudge?

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
&lt;/pre&gt;</description>
    <dc:creator>Tim Allen</dc:creator>
    <dc:date>2012-02-20T02:28:52</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5769">
    <title>Windows path syntax and global variables</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5769</link>
    <description>&lt;pre&gt;First, I just want to say that finding Factor has revived my desire to
learn programming again!

I am working through tutorials and online content, however, I am stuck with
one hurdle at the moment. I have set up my .factor-rc file to include the
following lines:

USING: namespaces io.directories io.pathnames editors.scite tools.scaffold;
"C:\\Program Files (x86)\\SciTE\\SciTE.exe" scite-path set-global
"myname" \ developer-name set-global

I F2, restart Factor Listener, but when I try to edit a file such as:

"boids" edit

It asks me to pick the editor, even though it's already picked in the
.factor-rc file, and it returns the following error message in an error
window:

Win32 error 0x2: The system cannot find the file specified.
Launch descriptor:

T{ process
    { command
        {
            "scite.exe"
            "C:\\Users\\myname\\factor/extra/boids/boids.factor"
            "-goto:1"
        }
    }
    { detached t }
    { environment H{ } }
    { environment-mode +append-environment+ }
    { group +same-group+ }
}

It seems like it is using the proper escaped back slash for Windows from my
current-directory global setting, but then the appended portion after is
using forward slashes. I am pretty sure that's why it can't walk the
directory in Windows to find the file. Any ideas? I can not find any
documentation on this portion of building the file path.

Thank you.

Rob
------------------------------------------------------------------------------
Virtualization &amp;amp; Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/_______________________________________________
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>Robert Herman</dc:creator>
    <dc:date>2012-02-19T12:43:05</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5766">
    <title>Factor for Dummies</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5766</link>
    <description>&lt;pre&gt;Please help me to begin programming. I can't do even one step. I have no experience in concatenative programming. I now read the book by Brodie, but I understand it badly. And that little bits of information, that I understand, I can not translate in the Factor. Please give me (and other newbies) simple manual. How to write first program step by step.

Some questions:
1. What is best win-editor for Factor? Oh no, not Emacs! I mean something like Programmer's Notepad.
2. What is Listener? It can be used as the editor? I open Listener, Browser, Errors...
3. I need some simple program. For example, calculation of a percentage parity of numbers. Input data: 1, 2, 3. Output data must be 0.167, 0.333, 0.5. How to create such program? I don't ask, that you have solved this problem for me. Show, how it is necessary to argue. My brain slip.
------------------------------------------------------------------------------
Virtualization &amp;amp; Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
&lt;/pre&gt;</description>
    <dc:creator>Вадим Тукаев</dc:creator>
    <dc:date>2012-02-18T08:52:59</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5765">
    <title>File Chooser Dialog</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5765</link>
    <description>&lt;pre&gt;Has any work been done on a file selector dialog in the GUI?

In the alternative, are there any bindings to GTK+ or wxWidgets?

Thanks,

Larry Coleman

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
&lt;/pre&gt;</description>
    <dc:creator>Larry Coleman</dc:creator>
    <dc:date>2012-01-13T15:08:53</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5762">
    <title>wave calculations</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5762</link>
    <description>&lt;pre&gt;Some interesting ideas and calculations here ...

http://www.glafreniere.com/matter.htm

Looks like the authors did the calculations in FreeBasic.

http://www.glafreniere.com/sa_electron.htm

Seems like any numerical calculation would be nicely done in Factor, due to
the mathematical nature of stack-based-languages.

One thought that came to mind while reading the website was, "These
calculations should be done in Factor, rather than FreeBasic."

 - Leonard
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev_______________________________________________
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>L N</dc:creator>
    <dc:date>2011-12-20T23:22:54</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5758">
    <title>Short-circuiting boolean operators?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5758</link>
    <description>&lt;pre&gt;I was unable to find short-circuiting boolean operators in Factor's
standard vocabs. Does it not have them? If not, why not? If yes, where are
they?

&lt;/pre&gt;</description>
    <dc:creator>missingfaktor</dc:creator>
    <dc:date>2011-12-20T20:41:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.factor.general/5755">
    <title>What does "fried" in "fried quotations" mean?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.factor.general/5755</link>
    <description>&lt;pre&gt;Or, why are fried quotations called what they are called?

&lt;/pre&gt;</description>
    <dc:creator>missingfaktor</dc:creator>
    <dc:date>2011-12-19T13:53:16</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>

