o you know about closures? So something like:
>>
>> (defn foo [arg1 arg2]
>> (fn [state] (do-something-with state arg1 arg2)))
>>
>> - James
>>
>> On 25 November 2014 at 18:55, Isaac Karth wrote:
>>
>>> I'm trying to build a string
I'm trying to build a string output system with functions that later have a
state passed to it, so that I can write something like (output "The result
of this example is: " (get :result)) and have it passed to a parsing
function that takes a state and calls the functions in the list, something
Thanks for all of the feedback so far, it's been helpful. Mars0i, keeping
an RNG for each thing that needs to have an independent random state seems
like a good idea for a fallback, and the suggestion of using a different
RNG is a good one. It's also helpful to know other people have dealt with
uses.
>
> I apologise for not providing any concrete answers, but this has been
> something I've been thinking about as well. You can quite easily narrow the
> scope of data a function has access to, but it's very hard to widen it
> again.
>
> - James
>
>
> O
I've been working on some projects (roguelikes, story-generators) that
often have a reason to have a random outcome for things like procedurally
generating a map. Ideally, they would be deterministically psuduorandom, so
that I can generate the same results from the same seed. The part I'm
havi