n the result is a foregone conclusion --- I just posted it because I was
curious.
regards --- Hugh
Message: 1
Date: Fri, 26 Feb 2016 15:36:57 -0800
From: John Benediktsson
Subject: Re: [Factor-talk] benchmark comparing Factor to ANS-Forth
To: Hugh Aguilar ,
"factor-talk@l
My first-ever ANS-Forth program was LowDraw.4th that was written about 12-15
years ago. It is now one of my example programs in the novice package:
http://www.forth.org/novice.html This program does a recursive-traversal of all
the possible hands in LowDraw poker given various drawing strategie
I remember CURRY but didn't know about the '[ _ + ] notation.
I never understood what the point of CURRY was --- why not just use the local
variable name [ N + ] for readability?
Anyway, where is the local-frame being held that it can persist after the
function has exited? Is it on the heap like
`[
call( x -- x ) ]``.
On Fri, Jul 10, 2015 at 8:09 PM, Hugh Aguilar
wrote:
> Jul 9 at 8:19 PM
> I sent this yesterday but it seems to have gotten lost --- if it ends up
> being double-posted, I apologize.
>
> Can quotations in Factor still be executed after the parent function has
>
Jul 9 at 8:19 PMI sent this yesterday but it seems to have gotten lost --- if
it ends up being double-posted, I apologize.
Can quotations in Factor still be executed after the parent function has gone
out of scope (done its EXIT)? Scheme/Lisp allows this, and they hold the local
frame of the par
something like this:
:: foo ( seq -- seq' )
1 :> temp
seq [ temp + ] map ;
IN: scratchpad { 1 3 5 } foo . { 2 4 6 }
Yes, that works.
If thats not what you meant, can you clarify?
On Fri, Jul 3, 2015 at 3:58 PM, Hugh Aguilar wrote:
Is it true that in Factor the
Is it true that in Factor the quotation has access to the parent function's
local variables?
Over on comp.lang.forth Bernd Payson has said that in Factor quotations do not
have access to the parent function's local variables --- he uses this argument
to justify that his "quotations" (just :NONAM
I designed the FMITE processor that could be built into an FPGA. It is designed
to have compact machine-code. It has support for quotations (a kind of lambda
function) that Forth-200x lacks:http://www.forth.org/FMITE.txt
In order to dodge the disrepute of ANS-Forth, I have changed the name of the
Does Factor have anything comparable to Forth's pictured numbers (the <# ... #>
functions)? What I am doing right now is using NUMBER>STRING and then modifying
the string, but this makes for pretty ugly code.
Also, does Factor have anything comparable to Forth's [CHAR] function? Your
function
Over on http://www.forthwiki.com I set up a forum devoted to Factor.
This forum allows people to attach programs to their posts and/or to upload
programs into the gallery. The idea is that people can post Factor programs
here, to make them public. These would be programs that aren't general-purp
I have been reading the Factor documentation. I think that Factor is likely not
capable of that slide-rule program that I described. I can write code to
generate SVG in any language (including Forth), but I need some way to turn
that SVG into an image that can be displayed on the screen. I don't
From: Jim mack
To: factor-talk@lists.sourceforge.net
Sent: Wed, February 3, 2010 10:02:50 PM
Subject: Re: [Factor-talk] slide-rule
> I am just getting started in Factor, and am partially drawn to the ability to
> do cross platform GUI development, but I thought
I completed my Forth program for generating gcode for etching aluminum
slide-rules. I can email it to anybody who wants it, and it is also available
on www.forth.org. It is pretty robust code and anybody with a little knowledge
of Forth can upgrade it to include custom scales. There are a lot of
Hello again. I've changed my email address. It was hugoagui...@rosycrew.com
previously, but that email is no longer in existence as my website is kaput
now. I think I may have missed a couple of weeks worth of your posts ---
hopefully you didn't say anything important while I was gone. :-)
I've
I recently ported symtab.factor over to Forth. During that process I
discovered a bug in the Factor version that I fixed. Here is the new
version:
www.rosycrew.org/symtab.factor
Here is the Forth version and another file containing some basic support:
www.rosycrew.org/symtab.4th
www.rosycrew.org/
Well, I decided to join the modern world and switch over from Windows to
Ubuntu (9.04). I found that the 64-bit version of Factor wouldn't run on my
computer (I got an error message that I can't execute a binary file), but
the 32-bit version did run okay. I have an AMD Turion MK38, which is 64-b
Cool! Thanks for volunteering.
Am I reading that correctly --- that it took 17 minutes and 28 seconds,
compared to 10 minutes for Slava's Factor version? That's pretty slow. The
next step will be to make the 0 and 1 tries run concurrently. That's my
intention with Erlang but I haven't started y
Note that, in the case of the HOW-FAR values being equal, I arbitrarily
chose to try 1 first and 0 second. If this is done the other way around you
still get a correct answer, but the time required will be different. For
some seed values, this will be improve the speed, and for other seed values
set=ISO-8859-1
>
> On Tue, Oct 20, 2009 at 8:58 PM, Hugh Aguilar
> wrote:
>> In regard to Factor, all that I did was inlining as I wasn't able to
>> figure out
>> what Slava was talking about in regard to rewriting HOW-FAR. This shaved
>> off
>> abou
My understanding of the FLUSH word is that it is supposed to flush the
output buffer before proceeding. The documentation says: "Waits for any
pending output on output-stream to complete."
This isn't happening on my Windows system (the 10-20-09 download). I noticed
this in regard to Slava's ver
Here is a new version of LC53: www.rosycrew.org/LC53.4th
I removed the assembly-language because it tended to clutter up the
source-code. It was originally included to provide a baseline benchmark, but
that is not particularly interesting and assembly-language is beyond the
scope of the book th
I made some improvements to both the Factor and Forth versions of LC53 in
both speed and style. I also fixed a bug in the games-and-simulations
section, although that didn't have anything to do with the encryption. I
also fixed my test.txt file so that it would say "Fourth Amendmend" rather
tha
I wrote a program to crack a linear-congruential (LC) encryption system. The
system is called LC53 (my invention), and it uses these constants:
unity = 2^32-5
mult = 2^32-3
LC encryption is fairly easy to crack, so nobody uses it in practice, but it
makes for a good test of a language i
> Message: 1
> Date: Sat, 10 Oct 2009 17:33:37 -0700
> From: "William Tanksley, Jr"
> Subject: Re: [Factor-talk] "Factor Versus Forth" --- the book
> To: factor-talk@lists.sourceforge.net
> Message-ID:
> <37d01e670910101733i544198f9hc42107dd9ee9d...@mail.gmail.com>
> Content-Type: text/plain; char
>
> Message: 4
> Date: Mon, 12 Oct 2009 01:07:47 +0200
> From: Samuel Tardieu
> Subject: Re: [Factor-talk] "Factor Versus Forth" --- the book
> To: factor-talk@lists.sourceforge.net
> Message-ID: <87iqelcyws@willow.rfc1149.net>
> Content-Type: text/plain; charset=us-ascii
>
> Hugh> A more mode
> Message: 6
> Date: Sat, 10 Oct 2009 18:48:53 -0500
> From: Doug Coleman
> Subject: Re: [Factor-talk] "Factor Versus Forth" --- the book
> To: factor-talk@lists.sourceforge.net
> Message-ID: <3a2525b0-76e7-4815-8641-f537d742e...@gmail.com>
> Content-Type: text/plain; charset=us-ascii; format=flo
I have an updated version. Please read it through all the way, rather than
just go to the new sections, as there is a lot of rewriting throughout.
Thanks for your continued help in improving this documentation.
The dvi is here: www.rosycrew.org/FactorVsForth.dvi
The pdf is here: www.rosycrew.org
> Message: 1
> Date: Tue, 6 Oct 2009 15:21:17 +1300
> From: Chris Double
> Subject: Re: [Factor-talk] "Factor vs. Forth" --- the book
> To: factor-talk@lists.sourceforge.net
> Message-ID:
>
> Content-Type: text/plain; charset=ISO-8859-1
> It's an interesting read - I like seeing what a Forth prog
Well, I've taken a stab at writing some documentation comparing Factor to
Forth. Take a look at this (www.rosycrew.org/FactorVsForth.dvi) and let me
know if this is going in a direction that you think will be useful.
Despite the title, I'm not allowing the book to become a "my language can
beat
> Message: 2
> Date: Tue, 29 Sep 2009 13:10:55 +0900
> From: Jon Harper
> Subject: Re: [Factor-talk] trash list, but keep symtab
> To: factor-talk@lists.sourceforge.net
> Message-ID:
> <8c7c5e590909282110j41e68543n674c82a7a4acf...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
>
> Message: 5
> Date: Sun, 27 Sep 2009 23:02:36 -0500
> From: Slava Pestov
> Subject: Re: [Factor-talk] trash list, but keep symtab
> To: factor-talk@lists.sourceforge.net
> Message-ID:
> <806f58f20909272102h589686a2nf7bc15221463c...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
Thanks for the tips on sequences. What you pointed out should work for my
slide-rule program. Even though I wrote list.factor I don't mind trashing it
in favor of a more idiomatic approach. Its just basic programming.
On the other hand, I wouldn't consider www.rosycrew.org/symtab.factor to be
b
> Message: 2
> Date: Sat, 26 Sep 2009 19:05:38 +
> From: Emeka
> Subject: Re: [Factor-talk] documentation, examples and help...
> To: factor-talk@lists.sourceforge.net
> Message-ID:
> <89c38c820909261205h6d0c1d92sdcdb19c914f9d...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
I use my list (www.rosycrew.org/list.factor) rather than sequences because I
have trouble doing what I want with sequences.
For example, I want to find a node in the list and split the list into two
lists at that point. With sequences, the function find returns an index into
the sequence. None
> Message: 2
> Date: Fri, 25 Sep 2009 19:57:07 -0500
> From: Slava Pestov
> Subject: Re: [Factor-talk] documentation, examples and help...
> To: factor-talk@lists.sourceforge.net
> Message-ID:
> <806f58f20909251757m16927f5oab3e7b34477f5...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-88
This problem is related to the problem I mentioned earlier in regard to
upgrading list.factor. I am now upgrading symtab.factor
(www.rosycrew.org/symtab.factor) and it won't compile. All of the functions
involved in finding a key in the tree fail, and all for the same reason
("unbalanced branch
n; charset=ISO-8859-1
>
> On Sun, Sep 20, 2009 at 11:25 AM, Hugh Aguilar
> wrote:
>> I upgraded as you requested and tried to also upgrade my software.
>> Previously, I had been allowed to pass quotations around on the stack,
>> store
>> them in symbols and get t
I upgraded as you requested and tried to also upgrade my software.
Previously, I had been allowed to pass quotations around on the stack, store
them in symbols and get them out again, and generally treat them as
first-class datums. Now I'm getting an error message that says: "Got a
computed val
In Forth we have abort" that terminates execution with an error message.
Does Factor have this? Can this be wrapped in conditional-compilation code
so that compilation of all these tests can be turned off after the program
is debugged and running?
How do I coerce numbers into a floats (in case
FICL will do what you want. See this page in the FICL documentation:
http://ficl.sourceforge.net/parsesteps.html
FICL has a lot of limitations, especially in regard to floating-point
support, but if you are willing to write wrappers for C functions as
necessary, it will work. Briefly, the doc s
Non-text messages don't seem to get through the mailing list. Can you email
this, whatever it is, to me directly?
To everybody --- thanks for all of your responses. I'm still learning Factor
and I'm sure there is a lot there that I don't know about. I'll look into
those parsing words that you m
The major feature of Forth is that it allows the programmer to write code
that executes at compile-time. To a large extent, this is not necessary in
Factor because the structure statements (if, while, etc.) use quots, and it
is possible to write your own in a similar manner.
I still see a need
6:42:27 -0500
> From: Slava Pestov
> Subject: Re: [Factor-talk] clone confusion
> To: factor-talk@lists.sourceforge.net
> Message-ID:
> <806f58f20909091442v46184f15u271f0c497728...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Wed, Sep 9, 200
Your clone doc says this:
"Outputs a new object equal to the given object. This is not guaranteed to
actually copy the object; it does nothing with immutable objects, and does
not copy words either. However, sequences and tuples can be cloned to obtain
a shallow copy of the original."
I am conf
I don't really understand how the concept of stack optimization can exist on
a processor such as the PIC18. I wrote a Forth cross-compiler for the 65c02
a long time ago; it has three registers (X, Y and A), with all data going
through the A. The PIC18 is essentially the same. There just isn't any
f
In regard to the slide-rule project, I'm making progress although I don't
hav much time for it, working 10-7 at my job; I'll show you the result when
done. I dropped SVG because it doesn't have very good support for print and
I went with LaTeX as originally planned. My program generates both LaTeX
I've got a big project in mind that will make use of BerkeleyDB but is on
the back burner for now, so there is no hurry. I'm working 7 days a week at
my job right now, which is preventing me from delving into any big projects;
I'll contact you when I have more time. I would be needing this for
I had never heard of staapl before but am now reading up on it at your
website; it looks pretty cool from what I've read so far. Do you have any
plans for upgrading from the PIC18 to the PIC24? I'm working on a PIC24
Forth compiler myself. I am mostly focused on the floating-point. I have
found
I had never heard of staapl before but am now reading up on it at your
website; it looks pretty cool from what I've read so far. Do you have any
plans for upgrading from the PIC18 to the PIC24? I'm working on a PIC24
Forth compiler myself. I am mostly focused on the floating-point. I have
found
I had never heard of staapl before but am now reading up on it at your
website. Do you have any plans for upgrading from the PIC18 to the PIC24?
I'm working on a PIC24 Forth compiler myself.
> Message: 4
> Date: Tue, 25 Aug 2009 08:21:28 +0200
> From: Tom Schouten
> Subject: [Factor-talk] Rewri
I've given some more thought to the subject of slide-rule construction.
LaTeX would work but is overly complicated as I am just working with the
vector graphics aspect. A simpler solution would be to write a Factor
program to generate an SVG file. I found an SVG library called Cairo
(http://cairogr
Does Factor offer any support for LaTeX? I'm working on building a
slide-rule and want to use Factor to generate the LaTeX code for the images
to be printed out as a pdf. I have my own idea for the design, so I can't
use any of the pdf files available by people who've already built
slide-rules.
Does Factor have anything akin to the generators in the ICON language?
Generators are useful for recursive-descent searches. They aren't necessary;
it is possible to write these kinds of programs without generators (I did
one such program in IBM370 assembly-language). When you do without
genera
Forth is primarily focused on micro-controllers, although it can be used on
desktop computers. Factor is primarily focused on desktop computers,
although it can be used on micro-controllers (a 32-bit chip running embedded
Linux).
My MFX Forth cross-compiler was for the MiniForth chip, which was
> Message: 2
> Date: Fri, 19 Jun 2009 10:39:30 +0200
> From: Samuel Tardieu
> Subject: Re: [Factor-talk] New here
> To: factor-talk@lists.sourceforge.net
> Message-ID: <877hz862il@willow.rfc1149.net>
> Content-Type: text/plain; charset=us-ascii
>
>>From my two years experience using Factor, I
I remember when I took French in H.S.; I didn't learn to speak French, and
it made my Spanish even worse than it already was because I would sometimes
insert French words into Spanish speech. The same thing would happen if you
tried to learn both Factor and Forth. This is especially true because
I found some software www.OpenSTV.org that does voting simulation.
I think that I want my votsim to allow the user to write his own voting
method in Factor. It is fairly easy to invent a voting method, such as my
double method, and I think that most users will want to try their hand at
doing th
Thanks for your advice. This is why I made the code public ---
to get specific advice on how to improve.
I didn't take your advice in regard to this one however:
: show-vote ( codes -- )
[ ballot get nth . ] each ;
I think show-vote has to stay as it is. Your suggestions just print out all
This has been a rough week for me due to automotive problems. I did find
time however to put together a simple voting simulation package:
www.rosycrew.com/votsim.factor. I am only supporting plurality voting (PV),
approval voting (AV), and borda voting at this time. Maybe later I will
provide h
Thanks for the pointers to books on voting systems; I'll look into them.
BTW, you are correct that PV means "plurality voting," not "preferential
voting." Personally, I call it "tribal voting" because it tends to segregate
people into tribes (liberals versus conservatives, etc.), with each tribe
I'm aware of unit testing, having read about it in a book: "Foundations of
Agile Python Development" (Jeff Younker). I don't have much experience with
it in any language though (I'm learning Python simultaneously with learning
Factor). Unit testing seems complicated for recursive functions. It m
Here is a very simple program that I wrote (www.rosycrew.org/list.factor)
that you might be interested in. I think that I am just duplicating what
Factor's vectors do, but I haven't really figured out vectors yet and it was
easier for me to just write my own --- I'm not very good at learning thi
My symtab program was somewhat boring. I am working on another program now
that should hopefully be more interesting. This is a simulation of voting
systems, derived from the book: "Mathematics and Democracy" (Steven Brams).
Brams is a long-time proponent of Approval Voting. This is a system whe
Thanks for your help; that first form is a lot clearer.
I have a slightly upgraded version of my program
(www.rosycrew.com/symtab.factor) that adds the words new-symtab and
new-forth-word --- as this seems to be the idiomatic way to do it (rather
than require the user to do his own xxx new and
Thanks for the tip on parameterized constructers; that did help. I think
that I should have been using new rather than boa. I have I changed symtab
and it is uploaded to the website if you want to look at it:
www.rosycrew.org/symtab.factor. I also fixed a bug in optimize that I
discovered.
There i
I've already seen those links you mentioned, but I'm still confused. How do
I define a constructor that will chain-call the constructors for the parent
classes? I want to define a class that is derived from symtab
(www.rosycrew.org/symtab.factor) and which adds some new slots. The
constructor for t
Has anybody ever written a tutorial on Factor OOP? I'm unclear on how this
works, but I don't want to waste everybody's time with dumb questions. If
there is no tutorial, can you point me towards example programs that
demonstrate Factor OOP fairly well? The Factor code that I've examined so
far
> Message: 4
> Date: Thu, 7 May 2009 21:04:15 -0500
> From: Daniel Ehrenberg
> Subject: Re: [Factor-talk] assembly language
> To: factor-talk@lists.sourceforge.net
> Message-ID:
>
> Content-Type: text/plain; charset=ISO-8859-1
>
> There's an x86, x86-64, and PPC port right now. Anyway, if you're
Has anybody ever written a Factor wrapper for Berkeley DB?
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, ther
> Message: 3
> Date: Wed, 6 May 2009 22:44:30 -0500
> From: Daniel Ehrenberg
> Subject: Re: [Factor-talk] symtab
> To: factor-talk@lists.sourceforge.net
> Message-ID:
>
> Content-Type: text/plain; charset=ISO-8859-1
>
> There are a number of ways that you can optimize the Factor code
> before res
This is off the topic of Factor, but are any of you familiar with Erlang? I
have wondered if it might be possible to get an Erlang-like multi-processor
system running on the 16-bit PIC24. The idea is that a robot would not have
one big processor (such as the ARM), but would have multiple small
I have my symtab program ready for you guys to look at. I havn't got it onto
github yet because my Linux system isn't working, so I just uploaded it to
my website where you can grab it: http://www.rosycrew.com/symtab.factor
This is a symbol table that uses an algorithm of my own invention. I
or
My understanding is that the if function does the first combinator for
nonzero numbers and the second combinator for zero numbers. This
doesn't seem to be working correctly though. Consider this code:
TUPLE: symtab key count weight left rite ;
: ( key -- node )
1 0 0 0 symtab boa ;
"hello"
> Message: 1
> Date: Thu, 30 Apr 2009 16:02:03 -0500
> From: Doug Coleman
> Subject: Re: [Factor-talk] question about <=>
> To: factor-talk@lists.sourceforge.net
> Message-ID: <82fa67e4-efac-4502-9984-c8c07c3f7...@gmail.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> Message: 4
> Date: Fri, 01 May 2009 10:47:59 +1200
> From: Jeremy
> Subject: Re: [Factor-talk] c-struct offset problem
> To: factor-talk@lists.sourceforge.net
> Message-ID: <87pret3gio.wl%jed...@gmail.com>
> Content-Type: text/plain; charset=US-ASCII
>
> FWIW, I've posted some code at http://pas
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 = [ ni
I had previously used SwiftForth ver. 2 from Forth Inc. under Windows XP, which
cost me $500. Now it doesn't work properly under Windows Vista (the help system
is kaput, for one thing). Forth Inc.'s help desk says: "You can buy a cheap
upgrade to the current version [3]." This would cost $296, w
> Message: 2
> Date: Wed, 15 Apr 2009 07:06:34 -0700
> From: William Tanksley
> Subject: Re: [Factor-talk] CAMF
> To: factor-talk@lists.sourceforge.net
> Message-ID: <1239804394.5559.83.ca...@tanksley>
> Content-Type: text/plain
>
> FICL is a tiny and elegant embedded language; Factor is a complet
Hello; I just learned about Factor today, and signed up for this mailing list.
I have programmed in Forth all of my life. I wrote the MFX cross-compiler for
the MiniForth processor at Testra, but I haven't worked there in many years now.
Currently, I am writing a library of functions that can be
79 matches
Mail list logo