Re: [Factor-talk] db.tuples and boolean types

2011-06-14 Thread Tadhg O'Meara
I tried this and it seems that 0 is treated as t. I guess because 0 is not f. I think I might have to use an INTEGER instead of a BOOLEAN type and that way I can select for 0 and 1. Thanks. On 14 June 2011 16:15, Fred Alger wrote: > I haven't tried this, but you might try passing a value that w

[Factor-talk] db.tuples and boolean types

2011-06-10 Thread Tadhg O'Meara
Hi, How do you select-tuples from a db with a slot set to f? The help says that "A SQL query is constructed from the slots of the exemplar tuple that are not f." So for example the following won't work: [ T{ book { sold f } } select-tuples ] with-books-db Do you have to use two slots, sold and u

Re: [Factor-talk] sqlite performance question

2011-04-21 Thread Tadhg O'Meara
That's great. It takes 0.3 seconds now. Thanks for the help. On 21 April 2011 22:59, Andrey Onymov wrote: > Oh, realized there is with-transaction word only after sending the message. > So it becomes > > : insert-test ( -- ) >          [ >              sqltest recreate-table >              [ 100

[Factor-talk] sqlite performance question

2011-04-21 Thread Tadhg O'Meara
It takes about 6 seconds to insert 100 records into a sqlite db on my Linux x64 system. Is sqlite normally that slow? Thanks, Tadhg Here is the code I used: USING: db db.sqlite db.tuples db.types ; TUPLE: sqltest id ; sqltest "SQLTEST" { { "id" "ID" +db-assigned-id+ } } define-persistent

Re: [Factor-talk] cond-case or similar word

2011-04-20 Thread Tadhg O'Meara
     [ second '[ drop @ ] ] bi 2array >                ] >                [ '[ drop @ ] ] if >        ] map '[ _  cond ] ; > > I guess someone can do a better code by coding a more specific cond. > > my 2 cents... > > At Tue, 19 Apr 2011 20:49:51 +0100, >

[Factor-talk] cond-case or similar word

2011-04-19 Thread Tadhg O'Meara
I'm looking for a word that's like cond but doesn't need all the dups and drops for the simple case where you want to check various properties of the object on the stack and call an appropriate quotation. So instead of { { [ dup 0 > ] [ drop "positive" ] } { [ dup 0 < ] [ drop "negative" ]

Re: [Factor-talk] New here

2009-06-19 Thread Tadhg O'Meara
For me this FAQ was a helpful intro to the ideas behind stack languages: http://www.latrobe.edu.au/philosophy/phimvt/joy/faq.html 2009/6/18 Emeka > Hello All, > > I'm new here and I would like to know where to start? i need introductory > materials and summary of what Factor is? > > Regards, >

Re: [Factor-talk] best way to search the documentation?

2009-05-14 Thread Tadhg O'Meara
g to search for in the top-left 'search' field. > > Slava > > On Thu, May 14, 2009 at 2:42 PM, Tadhg O'Meara wrote: >> Hi, >> >> What is the best way to search the documentation? I was looking for an >> infinity number and only found it after using

[Factor-talk] best way to search the documentation?

2009-05-14 Thread Tadhg O'Meara
Hi, What is the best way to search the documentation? I was looking for an infinity number and only found it after using grep from the command line which I found a bit messy and hard to read. I'm using FUEL but I'm new to emacs as well so maybe there's some emacs-fu that I'm not aware of. If ther