[Factor-talk] Question about running a factor httpd instance

2007-01-17 Thread bbrown
This may be a non question and I guess directed at Slava. But, I want to run a factor httpd instance similar to what is running on factorcode.org. Do you have the startup configuration in your init.d/ directory or did you just launch the server in background and let it run? It would probably b

Re: [Factor-talk] Question about running a factor httpd instance

2007-01-17 Thread Chris Double
What I do for my sites is run a factor instance inside a screen session on the server. I can attach and detach this so I always have access to the running repl. To start it up I do: "httpd" require USE: httpd [ httpd ] in-thread Which starts it on port . I redirect requests for port 80

Re: [Factor-talk] Question about running a factor httpd instance

2007-01-17 Thread Eduardo Cavazos
On Wednesday 17 January 2007 14:18, Chris Double wrote: > You could set this up to run using a startup script as well but I just > do it manually myself. I like to keep the REPL around so I can load > new modules, fix bugs, etc at runtime. Berlin, Here's one way to start httpd in a screen from a

[Factor-talk] longest

2007-01-17 Thread Eduardo Cavazos
Hello, Is there are word to find the longest item in a sequence? Here's what I'm using now. : compare-length ( a b -- n ) >r length r> length <=> ; : longer ( a b -- a-or-b ) 2dup compare-length 0 > -rot ? ; : longest ( seq -- obj ) dup first swap [ longer ] each ; Ed ---

[Factor-talk] longest factored

2007-01-17 Thread Eduardo Cavazos
Hello, Here's a maximum word that is more general than longest: : picker ( quot -- quot ) [ 2dup ] swap append [ 0 > -rot ? ] append ; : maximum ( seq quot -- item ) >r dup first swap r> picker each ; { "a" "ab" "abc" } [ compare-length ] maximum . ! longest { 10 20 30 40 } [ <=> ] maximum .

Re: [Factor-talk] Question about running a factor httpd instance

2007-01-17 Thread Slava Pestov
Hi, I use a file profile.factor that looks like this: REQUIRES: libs/httpd libs/furnace ; USING: httpd threads ; [ 8889 httpd ] in-thread Then I run Factor as follows: screen ./f factor.image profile.factor Once screen starts, I detach it. Later on I can attach to the screen and reload code

Re: [Factor-talk] Question about running a factor httpd instance

2007-01-17 Thread Slava Pestov
On 17-Jan-07, at 10:06 PM, Slava Pestov wrote: > Hi, > > I use a file profile.factor that looks like this: > > REQUIRES: libs/httpd libs/furnace ; > USING: httpd threads ; > > [ 8889 httpd ] in-thread Actually there are a few more lines to set the doc-root and such, but you get the idea. Slav