Re: [Factor-talk] User update magic in edit-profile

2010-02-23 Thread Alex Drummond
Sorry Slava, try the same repo again:

g...@github.com:addrummond/factor.git

Alex

On 23 February 2010 02:43, Slava Pestov sl...@factorcode.org wrote:
 On Tue, Feb 23, 2010 at 5:25 PM, Alex Drummond
 a.d.drumm...@googlemail.com wrote:
 I'm a bit of a git newbie, so let me know if you'd rather I pushed the
 changes some other way.

 Hi Alex,

 You might want to create your repository again. You removed the work
 folder, added work.zip, and removed a file from io.encodings.japanese.

 Slava

 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] User update magic in edit-profile

2010-02-22 Thread Alex Drummond
Hi Slava,

I've written some docs for the couchdb auth implementation and put it
up here (in master):

g...@github.com:addrummond/factor.git

I'm a bit of a git newbie, so let me know if you'd rather I pushed the
changes some other way.

Currently, there is nothing to stop a user editing their profile such
that they end up with the same registered email address as another
user. Eventually, I may try extending the auth protocol a bit to allow
errors of this sort to percolate.

Alex

On 21 February 2010 07:01, Slava Pestov sl...@factorcode.org wrote:
 On Sun, Feb 21, 2010 at 10:53 PM, Alex Drummond
 a.d.drumm...@googlemail.com wrote:
 What's the best way for me to
 send it to you?

 Set up a github account.

 I'll probably take a look at furnace.sessions at some point. Right now
 I am just using sqlite for sessions. In fact, this *probably* makes
 more sense than using couchdb, since couchdb has a write-only
 architecture which isn't ideal for making frequent updates to small
 documents. (Not that I have any data on this specific case -- just
 guessing.) But for sure there are plenty of non-SQL dbs out there that
 people might want to use for sessions.

 Or in-memory sessions for performance.

 Also, I've added a t:script tag to chloe which allows you to include
 scripts in the parent template either (i) inline between
 t:script/t:script, (ii) by specifying a local file to insert
 inline, or (iii) by setting 'src'. I'm also planning to update the
 t:style tag to be consistent with t:script. If you're interested
 in these updates, let me know.

 Sounds good.

 Slava

 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] User update magic in edit-profile

2010-02-21 Thread Alex Drummond
Hi,

I've written an implementation of the furnace authentication provider
protocol for couchdb. I decided to do a direct implementation, rather
than write a tuple db interface for couchdb, since when using couchdb
you need to jump through various hoops in order to ensure the
uniqueness of usernames and email addresses.

It's all working fine, except that the edit-profile controller is
not saving the modified user tuple back to the DB. I see that it sets
the changed? flag of the tuple once its submit action finishes, but
I'm having trouble working out how I should hook into whatever method
is supposed to get called in order to commit the update to the DB.

It works fine if I use the following nasty code to manually ensure
that a user-saver is created, and its destructor called:

edit-profile-action
[
responder [
 [
call( -- response )
logged-in-user get user-saver dispose
 ] curry
] change-submit drop
]
[ auth-boilerplate edit-profile add-responder ]
bi

But this is pretty ugly, and I'd like to know what the Right Way is,
if there is one. Any help appreciated.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] User update magic in edit-profile

2010-02-21 Thread Alex Drummond
Oops, when I switched back to using allow-edit-profile instead of the
hack in the previous email, it worked fine.

I guess there must previously have been a bug in my update-user method
which somehow led me to think that it wasn't being called at all. (I
am just using login-realm, so there wouldn't have been an issue with
call-next-method.)

sorry for the false alarm...
Alex

On 21 February 2010 04:08, Slava Pestov sl...@factorcode.org wrote:
 Hi Alex,

 Does the call-responder* method of your authentication realm execute
 call-next-method? Because M: realm call-responder* calls
 save-user-after, which sets up a destructor that will call update-user
 when the request is done. If you implement the update-user generic
 word then editing the profile should work.

 Slava

 On Sun, Feb 21, 2010 at 9:59 PM, Alex Drummond
 a.d.drumm...@googlemail.com wrote:
 Hi,

 I've written an implementation of the furnace authentication provider
 protocol for couchdb. I decided to do a direct implementation, rather
 than write a tuple db interface for couchdb, since when using couchdb
 you need to jump through various hoops in order to ensure the
 uniqueness of usernames and email addresses.

 It's all working fine, except that the edit-profile controller is
 not saving the modified user tuple back to the DB. I see that it sets
 the changed? flag of the tuple once its submit action finishes, but
 I'm having trouble working out how I should hook into whatever method
 is supposed to get called in order to commit the update to the DB.

 It works fine if I use the following nasty code to manually ensure
 that a user-saver is created, and its destructor called:

    edit-profile-action
    [
            responder [
                 [
                        call( -- response )
                        logged-in-user get user-saver dispose
                 ] curry
            ] change-submit drop
    ]
    [ auth-boilerplate edit-profile add-responder ]
    bi

 But this is pretty ugly, and I'd like to know what the Right Way is,
 if there is one. Any help appreciated.

 Alex

 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk


 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Chloe call-next-template

2010-02-12 Thread Alex Drummond
Thinking about it, what I really want to be able to do is include
templates by name inside other templates. I don't think that extending
call-next-template is the best way to accomplish this, since one may
wish to include one template file inside another without this having
any semantic significance (i.e. without it making sense to have a
nested form).

To this end, I added the following crude extension to chloe:

M: vocab vocabulary ( v -- v ) ;

CHLOE: include
[ vocab required-attr vocab ]
[ template required-attr ]
bi 2array resolve-template-path
.xml append
filexml body children
compile-children ;

I was really pleased by how easy it was to extend Chloe like this.
I'll definitely be more open to adding custom tags in the future. (I'd
assumed it would be more difficult.)

Of course, this doesn't do any namespacing stuff. That doesn't bother
me personally, but it probably is not suitable for inclusion as one of
the standard chloe tags.

Alex

On 11 February 2010 14:19, Alex Drummond a.d.drumm...@googlemail.com wrote:
 Hey Slava, thanks for the helpful response.

 Yes, I might see if I can extend the code a little. I guess there are
 roughly two ways of doing it. Either (i) chloe templates have access
 to data from parent forms by default (i.e. you can write t:label
 t:name=parent.parent.foo /) or (ii) templates continue to operate
 in a flat namespace, but there is a means of accessing values from
 parent forms in factor controller code. In the case of (ii), you would
 manually copy those values of interest into the child template's
 namespace in the init quotation (or wherever).

 Do you have any view on which (if either) is the better approach? I
 guess there would also be issues regarding where validation errors
 live. I haven't made much use of the validations system yet so I don't
 have any ideas about how this would work.

 For the moment, I think I will just generate the list XML in factor
 using the child template, then bung the generated XML into the parent
 template. I hadn't thought of doing this when I originally posted, but
 it seems like an ok workaround.

 Alex

 On 11 February 2010 07:23, Slava Pestov sl...@factorcode.org wrote:
 Hi Alex,

 The reason you can't do what you want to do is that both the
 boilerplate and action responders call begin-form at the top of their
 call-responder* methods.

 Chloe forms are built on top of actions and the machinery in the
 html.forms vocabulary. Nesting forms is supported only to the extent
 that validation errors work properly for a page with multiple forms.
 For example, in the pastebin, a Chloe template renders the actual
 paste, and there is a sub-template with the form for adding an
 annotation. Validation errors in the annotation form appear on the
 annotation template's components, instead of on components of the same
 name in the paste template.

 To support what you want to do, the templating code needs to be
 extended to support nested templates in a more advanced way. In
 particular, Chloe tags for placing components need to be able to
 address values from parent forms as well as child forms, using some
 kind of namespacing syntax.

 If that's a project you feel like taking on, let me know ;-)

 Slava

 On Thu, Feb 11, 2010 at 7:09 PM, Alex Drummond
 a.d.drumm...@googlemail.com wrote:
 Hi,

 I've noticed that values from the parent template don't seem to be
 available to a child template rendered via t:call-next-template. I
 would like to render a list of records, with the html template for
 each record in a separate template file. Could anyone tell me the best
 way to do this with Chloe? The child template is also used to render
 individual records in other contexts, so I'd really like to keep it in
 its own file.

 thanks,
 Alex

 --
 SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
 Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
 http://p.sf.net/sfu/solaris-dev2dev
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk


 --
 SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
 Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
 http://p.sf.net/sfu/solaris-dev2dev
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk



--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Factor-talk

Re: [Factor-talk] Chloe call-next-template

2010-02-12 Thread Alex Drummond
It's a pretty ordinary CRUD application. The idea is to present
upcoming events in linguistics in an accessible way. Currently, most
conferences etc. are announced on the Linguist List mailing list,
which works great as a mailing list, but is not an ideal way to keep
track of deadlines etc. I have some nasty Perl code which grovels
emails from the mailing list for conference/job announcements and puts
them into a CouchDB database. Now I'm writing a frontend to it in
factor (also allowing events to be added directly, etc.) I started off
writing the front end in Perl too, but I thought it would be more
interesting to try it in factor. As you know, the actual code for this
sort of thing tends to be incredibly dull, so it's nice to at least
write it in a cool language :)

It may never get finished, as I'm just doing it for fun and I have to
prioritize my (ahem) real work as a grad student.

Alex

On 12 February 2010 06:56, Slava Pestov sl...@factorcode.org wrote:
 I'm curious, what are you building with Furnace and Factor?

 Slava

 On Fri, Feb 12, 2010 at 9:58 PM, Alex Drummond
 a.d.drumm...@googlemail.com wrote:
 Thinking about it, what I really want to be able to do is include
 templates by name inside other templates. I don't think that extending
 call-next-template is the best way to accomplish this, since one may
 wish to include one template file inside another without this having
 any semantic significance (i.e. without it making sense to have a
 nested form).

 To this end, I added the following crude extension to chloe:

    M: vocab vocabulary ( v -- v ) ;

    CHLOE: include
        [ vocab required-attr vocab ]
        [ template required-attr ]
        bi 2array resolve-template-path
        .xml append
        filexml body children
        compile-children ;

 I was really pleased by how easy it was to extend Chloe like this.
 I'll definitely be more open to adding custom tags in the future. (I'd
 assumed it would be more difficult.)

 Of course, this doesn't do any namespacing stuff. That doesn't bother
 me personally, but it probably is not suitable for inclusion as one of
 the standard chloe tags.

 Alex

 On 11 February 2010 14:19, Alex Drummond a.d.drumm...@googlemail.com wrote:
 Hey Slava, thanks for the helpful response.

 Yes, I might see if I can extend the code a little. I guess there are
 roughly two ways of doing it. Either (i) chloe templates have access
 to data from parent forms by default (i.e. you can write t:label
 t:name=parent.parent.foo /) or (ii) templates continue to operate
 in a flat namespace, but there is a means of accessing values from
 parent forms in factor controller code. In the case of (ii), you would
 manually copy those values of interest into the child template's
 namespace in the init quotation (or wherever).

 Do you have any view on which (if either) is the better approach? I
 guess there would also be issues regarding where validation errors
 live. I haven't made much use of the validations system yet so I don't
 have any ideas about how this would work.

 For the moment, I think I will just generate the list XML in factor
 using the child template, then bung the generated XML into the parent
 template. I hadn't thought of doing this when I originally posted, but
 it seems like an ok workaround.

 Alex

 On 11 February 2010 07:23, Slava Pestov sl...@factorcode.org wrote:
 Hi Alex,

 The reason you can't do what you want to do is that both the
 boilerplate and action responders call begin-form at the top of their
 call-responder* methods.

 Chloe forms are built on top of actions and the machinery in the
 html.forms vocabulary. Nesting forms is supported only to the extent
 that validation errors work properly for a page with multiple forms.
 For example, in the pastebin, a Chloe template renders the actual
 paste, and there is a sub-template with the form for adding an
 annotation. Validation errors in the annotation form appear on the
 annotation template's components, instead of on components of the same
 name in the paste template.

 To support what you want to do, the templating code needs to be
 extended to support nested templates in a more advanced way. In
 particular, Chloe tags for placing components need to be able to
 address values from parent forms as well as child forms, using some
 kind of namespacing syntax.

 If that's a project you feel like taking on, let me know ;-)

 Slava

 On Thu, Feb 11, 2010 at 7:09 PM, Alex Drummond
 a.d.drumm...@googlemail.com wrote:
 Hi,

 I've noticed that values from the parent template don't seem to be
 available to a child template rendered via t:call-next-template. I
 would like to render a list of records, with the html template for
 each record in a separate template file. Could anyone tell me the best
 way to do this with Chloe? The child template is also used to render
 individual records in other contexts, so I'd really like to keep it in
 its own file.

 thanks,
 Alex

Re: [Factor-talk] Chloe call-next-template

2010-02-11 Thread Alex Drummond
Hey Slava, thanks for the helpful response.

Yes, I might see if I can extend the code a little. I guess there are
roughly two ways of doing it. Either (i) chloe templates have access
to data from parent forms by default (i.e. you can write t:label
t:name=parent.parent.foo /) or (ii) templates continue to operate
in a flat namespace, but there is a means of accessing values from
parent forms in factor controller code. In the case of (ii), you would
manually copy those values of interest into the child template's
namespace in the init quotation (or wherever).

Do you have any view on which (if either) is the better approach? I
guess there would also be issues regarding where validation errors
live. I haven't made much use of the validations system yet so I don't
have any ideas about how this would work.

For the moment, I think I will just generate the list XML in factor
using the child template, then bung the generated XML into the parent
template. I hadn't thought of doing this when I originally posted, but
it seems like an ok workaround.

Alex

On 11 February 2010 07:23, Slava Pestov sl...@factorcode.org wrote:
 Hi Alex,

 The reason you can't do what you want to do is that both the
 boilerplate and action responders call begin-form at the top of their
 call-responder* methods.

 Chloe forms are built on top of actions and the machinery in the
 html.forms vocabulary. Nesting forms is supported only to the extent
 that validation errors work properly for a page with multiple forms.
 For example, in the pastebin, a Chloe template renders the actual
 paste, and there is a sub-template with the form for adding an
 annotation. Validation errors in the annotation form appear on the
 annotation template's components, instead of on components of the same
 name in the paste template.

 To support what you want to do, the templating code needs to be
 extended to support nested templates in a more advanced way. In
 particular, Chloe tags for placing components need to be able to
 address values from parent forms as well as child forms, using some
 kind of namespacing syntax.

 If that's a project you feel like taking on, let me know ;-)

 Slava

 On Thu, Feb 11, 2010 at 7:09 PM, Alex Drummond
 a.d.drumm...@googlemail.com wrote:
 Hi,

 I've noticed that values from the parent template don't seem to be
 available to a child template rendered via t:call-next-template. I
 would like to render a list of records, with the html template for
 each record in a separate template file. Could anyone tell me the best
 way to do this with Chloe? The child template is also used to render
 individual records in other contexts, so I'd really like to keep it in
 its own file.

 thanks,
 Alex

 --
 SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
 Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
 http://p.sf.net/sfu/solaris-dev2dev
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk


 --
 SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
 Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
 http://p.sf.net/sfu/solaris-dev2dev
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk


--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] can somebody test a factor branch on macosx for me please?

2009-08-22 Thread Alex Drummond
It compiles ok, but I get the same bootstrap error for both images:

*** Stage 2 early init... You have triggered a bug in Factor. Please report.
critical_error: Bad rel type: c009

This was using make macosx-x86-32' / make macosx-x86-64, and then
./factor -i=IMAGE to bootstrap. It's been a while since I've done a
build without the factor.sh script, so sorry if I was just executing
the wrong commands.

Alex

2009/8/22 Phil Dawes p...@phildawes.net:
 Hi Factor list,

 I'm still working toward a kernel threaded factor vm and the finish line
 is in sight! The only problem is that I don't have a macosx platform to
 test on. If there's anybody reading this on osx with a build setup would
 you mind testing this for me please?:

 http://github.com/phildawes/factor/tree/reentrantvm-dev
 http://phildawes.net/tmp/images/boot.x86.32.image
 http://phildawes.net/tmp/images/boot.unix-x86.64.image

 I'm hoping it should compile and bootstrap fine (win32 and linux64 are
 working).

 Many thanks,

 Phil


 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
 trial. Simplify your report design, integration and deployment - and focus on
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Division by zero

2009-05-02 Thread Alex Drummond
Hi all,

The new 1/0 0/0 -1/0 syntax for the special floating point values
seems to raise a division by zero error whenever it's used. For
example, in evaluating the following expression:

1/0 0.0 

Is there any way of using these values in calculations that doesn't
cause an error to be raised? I couldn't find anything in the
documentation on floats.

thank you,
Alex

--
Register Now  Save for Velocity, the Web Performance  Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance  Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Division by zero

2009-05-02 Thread Alex Drummond
Ah, but if you actually evaluate [ 1.0 0.0 / ], it seems that you get
the value 1/0 and no error is raised in subsequent calculations using
this value.
Alex

2009/5/2 Alex Drummond a.d.drumm...@googlemail.com:
 Hi all,

 The new 1/0 0/0 -1/0 syntax for the special floating point values
 seems to raise a division by zero error whenever it's used. For
 example, in evaluating the following expression:

 1/0 0.0 

 Is there any way of using these values in calculations that doesn't
 cause an error to be raised? I couldn't find anything in the
 documentation on floats.

 thank you,
 Alex


--
Register Now  Save for Velocity, the Web Performance  Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance  Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] init-gadget

2009-03-24 Thread Alex Drummond
Hi, I just noticed that the init-gadget word was removed at some
point. Can I just remove calls to this in my UI code (this seems to
work), or is no explicit initialization necessary any more?
thanks,
Alex

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] FFI question

2009-02-08 Thread Alex Drummond
Hi, I was wondering if there is any way to pass a Factor object to C
callback that was constructed using alien-callback.
thanks,
Alex

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Strange 'let' behavior

2009-01-31 Thread Alex Drummond
Hi,

Not sure if I'm misunderstanding how let is supposed to work, but I'm
getting some strange behavior when using it to bind symbols to
multiple values. Specifically, the 'good' word works as expected, but
the 'bad' word doesn't:

: good ( -- v ) [let | x [ 1 2 ] | x drop ] ;
: bad ( -- v ) [let | x [ 1 2 ] | x 2drop x drop ] ;

'good' returns 1, as expected, whereas 'bad' leads to a compile error
and adds nothing to the stack.

Alex

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Locals Usage

2009-01-22 Thread Alex Drummond
Dan This is my philosophy too. I do use locals sometimes, but
Dan typically only one or two locals words per vocabulary. The
Dan version without locals is usually cleaner, I find.

Same here, mostly. I think a good knowledge of the libraries really
helps for writing clean stack code, because this way most of the local
state ends up stored in objects (e.g. your current position in a
sequence is stored in a slice object, rather than being another
variable that you have to carry around on the stack).

Alex

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Which Emacs to use on Mac?

2009-01-12 Thread Alex Drummond
I use Carbon Emacs which you can download from apple's site:

http://www.apple.com/downloads/macosx/unix_open_source/carbonemacspackage.html

I think it's more or less the same as Emacs.app from the CVS.

Alex

2009/1/12 Jon Kleiser jon.klei...@usit.uio.no:
 Hi,

 Which Emacs do you recommend for use with Factor/FUEL on Mac OS X (Intel)?

 Is Aquamacs a good one?

 /Jon

 --
 Check out the new SourceForge.net Marketplace.
 It is the best place to buy or sell services for
 just about anything Open Source.
 http://p.sf.net/sfu/Xq1LFB
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] sequences.lib

2008-12-19 Thread Alex Drummond
Hi,

I was just wondering what's going on with the removal of the
sequences.lib vocabulary. Some useful words like reduce* seem to have
been lost. Is there any particular reason for removing these rather
than moving them to another vocab?

thanks,
Alex

--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] sequences.lib

2008-12-19 Thread Alex Drummond
That all makes sense, I would just suggest reduce* (the reduce that
requires the list to be of at least length one) as a useful word to
have in the sequences library. This is mostly my own personal bias, as
I've found it useful in my own code, but FWIW Haskell has an
equivalent in its standard List library (foldl1).

Alex

2008/12/19 Slava Pestov sl...@factorcode.org:
 The existence of sequences.lib, combinators.lib and so on always
 bothered me, and I was opposed to the idea from the very start,
 because instead of thinking about the right place to put a utility
 word, people would just dump them in there. So we ended up with an
 ad-hoc grab-bag of utilities with no consistency, documentation or
 tests. Many of them were not used, and didn't even work correctly.
 Over time the useful and clean words were split off into their own
 vocabularies or moved into core, and code in basis/ and extra/ that
 used the *.lib vocabularies was refactored to use the new words, or in
 some cases, not need them.

 Now that nothing in basis/ and extra/ used them anymore, I put them in
 unmaintained/, and this is where they will stay.

 If you see some words in there that are useful, and there is no clean
 way to express your code without them, and you don't want to just have
 a copy of these words in your own vocabulary as a private utility,
 then we can consider moving them into a new vocabulary, or even the
 core.

 But I don't want to return to having these vocabularies of random,
 poorly-documented and poorly-tested utilities that end up cluttering
 the language only to save a few tokens here and there.

 Slava

 On Fri, Dec 19, 2008 at 7:28 AM, Alex Drummond
 a.d.drumm...@googlemail.com wrote:
 Hi,

 I was just wondering what's going on with the removal of the
 sequences.lib vocabulary. Some useful words like reduce* seem to have
 been lost. Is there any particular reason for removing these rather
 than moving them to another vocab?

 --
 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk


--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk