Oh, OK. Thank you for the explanation, John!
18.05.2017, 01:54, "John Benediktsson" :
> Right now fry doesn't support "frying" into sequences that aren't quotations,
> so this works:
>
> '[ [ _ ] ]
>
> But this doesn't:
>
> '[ { _ } ]
>
> We have a plan to fix this as
Right now fry doesn't support "frying" into sequences that aren't quotations,
so this works:
'[ [ _ ] ]
But this doesn't:
'[ { _ } ]
We have a plan to fix this as it turns out I was talking about this issue a
couple days ago with someone. I'd like to make this fix since a lot of
Hello!
I have the following code, and it works:
TUPLE: resource-gadget < track res ;
: find-resource-window ( resource -- world/f )
[ { [ drop resource-gadget? ] [ res>> = ] } 2&& ] curry find-window ;
Resource-gadget is a container for a resource tuple (in the res slot). The
function
Sam == Samuel Tardieu s...@rfc1149.net writes:
Sam It looks like _ is not substituted within { } in a fry expression:
Sam
Sam ( scratchpad ) [ '[ { _ } ] ] infer.
Sam ( -- object)
Sam
Sam It makes it difficult to use a case inside a fry. Is it on purpose?
Ping?
Sam
--
Samuel Tardieu --
On Fri, Jun 5, 2009 at 5:17 AM, Samuel Tardieus...@rfc1149.net wrote:
Sam == Samuel Tardieu s...@rfc1149.net writes:
Sam It looks like _ is not substituted within { } in a fry expression:
Sam
Sam ( scratchpad ) [ '[ { _ } ] ] infer.
Sam ( -- object)
Sam
Sam It makes it difficult to use
On Saturday 01 November 2008 22:28:43 Slava Pestov wrote:
I'll try and fix it.
OK. For what it's worth, if it complicates the implementation too much, I
wonder if it's worth it to do. Mixing frying and lambdas seems a little
strange; if you're already naming things (let, lambda, etc), you
On Sun, Nov 2, 2008 at 1:45 AM, Eduardo Cavazos [EMAIL PROTECTED] wrote:
OK. For what it's worth, if it complicates the implementation too much, I
wonder if it's worth it to do. Mixing frying and lambdas seems a little
strange; if you're already naming things (let, lambda, etc), you might as
Slava,
What's the official stance on mixing fry and lambdas? In particular, using '_'
inside of a lambda body. For example, this works:
'[ [let | A [ 1 ] | A . 10 . ] ] call
But this, which should be equivalent, does not:
10 '[ [let | A [ 1 ] | A . _ . ] ] call
Ed
I'll try and fix it.
On Sat, Nov 1, 2008 at 9:36 PM, Eduardo Cavazos [EMAIL PROTECTED] wrote:
Slava,
What's the official stance on mixing fry and lambdas? In particular, using '_'
inside of a lambda body. For example, this works:
'[ [let | A [ 1 ] | A . 10 . ] ] call
But this,
Dan,
It might be nice if we could get rid of 2curry, 3curry, 3compose,
prepose eventually. For example, consider this snippet which uses
2curry twice:
[
[ dup link where dup ] 2dip
[ r r first r at r push-at ] 2curry
[ 2drop ]
if
] 2curry each
The fry version is a lot clearer:
hm In this case fry looks 10 times nicer to my untrained eyes also.
On Mon, Sep 1, 2008 at 2:04 AM, Slava Pestov [EMAIL PROTECTED] wrote:
Dan,
It might be nice if we could get rid of 2curry, 3curry, 3compose,
prepose eventually. For example, consider this snippet which uses
2curry twice:
[
Well, personally, I never got used to fry. I feel comfortable using
curry and compose for most things. I don't see why it is a problem to
use them except in exceptionally complicated cases. For me, it feels
like fry is doing more than is needed. Are you suggesting that we use
{ 1 2 3 } 4 '[ , + ]
Hi Dan,
Yes, that is what I'm suggesting. fry cannot express 'with' so we wouldn't
do anything about usages of that word.
Thanks for the input. I'll probably do a sweep of my own code at some point
to convert curry/compose to fry, since I find fry more aesthetically
pleasing, but I'll let other
Slava wrote:
fry cannot express 'with' so we wouldn't do anything about usages of that
word.
Dan wrote:
I'm not sure how to do what with does in terms of fry.
10 { 0 1 2 3 4 } [ - ] with map
Using fry:
10 { 0 1 2 3 4 } swap '[ , _ - ] map
I'm not saying it's prettier...
Entering ``fry about'' in the listener will explain what it's all about.
And FWIW, there is already a ``Web 2.0'' startup named REFACTR:
http://refactr.com/ :-)
Slava
On Sun, Aug 31, 2008 at 5:52 PM, janko metelko [EMAIL PROTECTED] wrote:
I have used curry but I haven't fry and I don't know
I am not at my factor computer so can't try it right now , but will tomorrow.
refactr? these web 2.0 names are really science of it's own :) they
have a db error on their page.
I have to call it refaktor because we can't have company names with
english words ... it's just a company name... my
Hi all,
Now that the 'fry' abstraction has been around for a while, how do people
feel about using it? Should we generally try to phase out direct usages of
'curry' as much as possible, except for in the core, and use 'fry'
everywhere else in basis and extra?
Slava
I have the same feeling about locals and now-considered-evil stack
shufflers. All of these have some value as language features,
especially to make development easier, but it seems like
well-factored, well-written code doesn't use them all that much.
Dan
On Thu, Jul 24, 2008 at 8:58 PM, Slava
Hi all,
I like fry very much, but I've noticed that most of my usages of 'fry'
are pretty trivial, stuff like
'[ , foo ]
'[ , , foo ]
Or sometimes the slightly more elaborate
'[ swap , foo ]
'[ drop , foo ]
I've been trying to reconcile these two facts, and I think I've figured it out.
In
If it's not too much trouble, could someone tell me what fry is?
On Thu, Jul 24, 2008 at 11:58 PM, Slava Pestov [EMAIL PROTECTED] wrote:
Hi all,
I like fry very much, but I've noticed that most of my usages of 'fry'
are pretty trivial, stuff like
'[ , foo ]
'[ , , foo ]
Or sometimes the
On Thu, Jul 24, 2008 at 11:30 PM, David Petersheim
[EMAIL PROTECTED] wrote:
If it's not too much trouble, could someone tell me what fry is?
Fire up Factor, and run
fry about
Slava
-
This SF.Net email is sponsored by the
Dan,
I spotted a place in 'inverse' where fry can be used nicely:
: recover-chain ( seq -- quot )
[ no-match ] [ swap \ recover-fail 3array quotation ] reduce ;
: recover-chain ( seq -- quot )
[ no-match ] [ swap '[ , , recover-fail ] ] reduce ;
Ed
Feel free to change this if you care about it. I don't mind the old
version of this enough to change it myself.
Dan
On Sun, Jul 6, 2008 at 10:37 AM, Eduardo Cavazos [EMAIL PROTECTED] wrote:
Dan,
I spotted a place in 'inverse' where fry can be used nicely:
: recover-chain ( seq -- quot )
What does one have to search for in order to read about 'fry'? Clearly
'fry' isn't the name of a vocabulary word, since it doesn't appear in
any source you're showing, nor does Google find in when I search on
factorcode.com; can someone post a Rosetta stone?
-Wm
Bruno [EMAIL PROTECTED] wrote:
William Tanksley, Jr [EMAIL PROTECTED] wrote:
What does one have to search for in order to read about 'fry'? Clearly
It is on git, the version at factorcode is 0.91.
Are you implying that the prebuilt binaries of 0.91 are not the right
place to start looking?
Chris Double wrote:
The easiest way is via the git repository since that contains the
latest fry stuff. If you are on Windows I suggest installing cygwin.
In fact, cygwin is required to compile (but not run) Factor.
Make sure you include gcc and git. You can then get the git repository
Hi Chris,
This is not supported yet.
Another option there is to use locals instead of match-replace:
[let | quot [ ... ] |
[ ... [ ... quot ... ] ... ] ]
However fry is lighter (syntax-wise) and what you're proposing would
make a great addition so I will implement it soon.
Slava
Chris
Is fry supposed to work with nested quotations, or should I be using
some other construct? eg:
3 '[ 1 2 [ , ] ]
= [ 1 2 [ 3 ] ]
It doesn't yet... I've wanted to do stuff like this also. My workaround looks
like this:
3 '[ , ] '[ 1 2 , ]
Ed
Hi all,
Here is an example usage of the new 'fry' abstraction:
: with-exit-continuation ( quot -- )
'[ exit-continuation set @ ] callcc1 exit-continuation off ;
This is equivalent to any one of the following:
: with-exit-continuation ( quot -- )
[ exit-continuation set call ] callcc1
Chris Double wrote:
Shouldn't this be run in a scope or is fry doing that for you? If you
have nested with-exit-continuation calls, then the inner will
overwrite the exit-continuation won't it?
Chris.
This word intentionally doesn't use a scope. This is from the HTTP
server which does
Slava == Slava Pestov [EMAIL PROTECTED] writes:
Slava FWIW, fry is documented now.
This is very neat!
But I am surprised by the behaviour of _; I would have imagined that
it would have skipped (and kept) the corresponding data on the stack
at frying time, to keep the natural order.
The
31 matches
Mail list logo