Re: [Factor-talk] Question about updating models in UI gesture handlers

2016-10-21 Thread Sankaranarayanan Viswanathan
Never-mind folks. Turned out to be a simple bug, my menu-items word did not correctly return the items of the menu passed in. Fixing that solved my issue :) Thanks, Sankar On 10/21/16 12:16 AM, Sankaranarayanan Viswanathan wrote: > Hi, > > I'm trying to use the models vocabulary in order to

[Factor-talk] Question about updating models in UI gesture handlers

2016-10-20 Thread Sankaranarayanan Viswanathan
Hi, I'm trying to use the models vocabulary in order to implement keyboard navigation on menus. I still have some work to do, but right now I have something like this: :: prepare-menu ( menu -- ) f :> model menu menu-items :> items items [ model add-connection ] each model

Re: [Factor-talk] question about SIMD and alien arrays

2009-10-13 Thread Slava Pestov
On Mon, Oct 12, 2009 at 9:51 PM, Ed Swartz eswa...@austin.rr.com wrote: Hi, Is there any support currently, or a plan to support, vector words using SIMD on alien arrays? This is planned. The first step is to get the SIMD primitives worked out, after that we can start writing higher-level

[Factor-talk] question about SIMD and alien arrays

2009-10-12 Thread Ed Swartz
Hi, Is there any support currently, or a plan to support, vector words using SIMD on alien arrays? It seems there's currently only support for using these words with explicitly register-sized vectors. When I hear of SIMD, though, it's usually in the context of operating on large datasets. It

Re: [Factor-talk] question about [] [] if

2009-05-01 Thread Chris Double
On Sat, May 2, 2009 at 9:21 AM, Hugh Aguilar hugoagui...@rosycrew.com wrote: My understanding is that the if function does the first combinator for nonzero numbers and the second combinator for zero numbers. The first combinator is run for true values and the second for false values. Instead of

[Factor-talk] question about =

2009-04-30 Thread Hugh Aguilar
Here is a function that I wrote: : ?sgn ( value negative-combinator zero-combinator positive-combinator -- ) roll! -- neg zer pos value dup 0 [ drop 2nip call ] [ nip ! -- neg zer value 0 = [

Re: [Factor-talk] question about =

2009-04-30 Thread Daniel Ehrenberg
The idiom for = is that the result is eventually consumed by a case. For example: : do-something ( n m -- ) = { { +lt+ [ Less ] } { +gt+ [ Greater ] } { +eq+ [ Equal ] } } case print ; With locals, you can implement this ?sgn combinator in terms of case as this:

[Factor-talk] Question about convert *.h to *.ffi

2009-03-04 Thread Caesar Hu
Hi, all I'm study C library interface, viewing cairo/ffi.factor, then I have a question: Is there a tool to convert *.h to ffi.factor, like : cairo.h: typedef struct _cairo_matrix { double xx; double yx; double xy; double yy; double x0; double y0; } cairo_matrix_t;

Re: [Factor-talk] Question about convert *.h to *.ffi

2009-03-04 Thread Daniel Ehrenberg
No, there's no tool like that. Such a tool would be a lot of work, since it would involve implementing a C header parser and preprocessor in the general case. This has been done in the SWIG project, I think, but no one has done this for Factor's FFI. It looks like it'd be possible to bind to SWIG

Re: [Factor-talk] Question about convert *.h to *.ffi

2009-03-04 Thread Caesar Hu
Thank you Daniel, I will try SWIG first. Cheers 2009/3/5 Daniel Ehrenberg micro...@gmail.com No, there's no tool like that. Such a tool would be a lot of work, since it would involve implementing a C header parser and preprocessor in the general case. This has been done in the SWIG project,

[Factor-talk] Question about 'color' from 'benchmark.mandel'

2008-09-11 Thread Eduardo Cavazos
Slava, : color ( iterations -- color ) [ color-map [ length mod ] keep nth ] [ B{ 0 0 0 } ] if* ; inline Is the length of 'color-map' being computed each time 'color' is called? In versions of the code that I was experimenting with, I factored out the color selection part: :

[Factor-talk] Question about vm/primitives.h

2007-10-07 Thread Samuel Tardieu
In vm/primitives.h, I read: | We do the assignment of stack_chain-callstack_top in a ``noinline'' | function to inhibit assignment re-ordering. stack_chain being global, in which case could an assignment re-ordering occur? (the compiler doesn't know if it will be used in subsequent functions, so

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