Hi,
Am 14.01.2012 um 14:19 schrieb Erlis Vidal:
> Sometimes while solving a problem, we can not see simpler solutions.
>
> What do you think?
Clojure is homoiconic. Walk the output of the reader and for each symbol do a
(resolve sym) and check the Var against the list of forbidden Vars. Info
Hi guys,
I don't know how the validations for this are done, but in this case I can
think on a naive check for the usage of a banned function. I think a regex
can do it. Something that look for* (count\s*+*
*
I know maybe there are more edges cases but I don't think it'll be much
than that. I unde
I responded to this earlier, but I accidentally hit the 'reply to author'
button instead of 'reply to post', and thus it went directly to Cedric
rather than to the group. I'll respond here and quote the previous emails:
On Fri, Jan 13, 2012 at 8:57 PM, Anthony Grimes
wrote:
> 4Clojure uses cl
On Jan 13, 2012, at 4:47 PM, Anthony Grimes wrote:
> Clojail errs on the side of safety and not on the side of "Oh, well maybe he
> wasn't trying to break the sandbox. Let's allow it anyway.". Treating macros
> as opaque is just another hole in what is already difficult sandboxing.
> Macros ar
An alternative solution to trying to make macros opaque is just to
disallow the macros which depend on disallowed functions. It should be
a relatively simple matter to generate this list programmatically from
clojure.core source. So instead of just saying "You can't use count."
It would say "You c
On Fri, Jan 13, 2012 at 6:47 PM, Anthony Grimes wrote:
> Clojail errs on the side of safety and not on the side of "Oh, well maybe he
> wasn't trying to break the sandbox. Let's allow it anyway.". Treating macros
> as opaque is just another hole in what is already difficult sandboxing.
> Macros ar
Clojail errs on the side of safety and not on the side of "Oh, well maybe
he wasn't trying to break the sandbox. Let's allow it anyway.". Treating
macros as opaque is just another hole in what is already difficult
sandboxing. Macros are not even remotely close to functions. They *create*
code.
On Thu, Jan 12, 2012 at 3:31 AM, markus wrote:
> Computers don't accuse, they process data. And they are not (yet?)
> capable of reading a user's intentions.
Technically no, but it's doubtful that a user using a macro like "for"
intends to "cheat", so from the *programmer's* standpoint it's not
c
Computers don't accuse, they process data. And they are not (yet?)
capable of reading a user's intentions.
On 11 Jan., 19:02, Cedric Greevey wrote:
> It seems dubious to me that it accuses users of cheating when they
> clearly had no intent to cheat. Is this intended behavior of 4Clojure
> or a b
Hi Cedric,
You know what? Now I understand what happens but while solving the problem
I though something was wrong. Maybe this is something to consider in the
future.
Thanks for all the responses.
On Wed, Jan 11, 2012 at 1:02 PM, Cedric Greevey wrote:
> It seems dubious to me that it accuses u
It seems dubious to me that it accuses users of cheating when they
clearly had no intent to cheat. Is this intended behavior of 4Clojure
or a bug?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroup
Thank you guys, for all the tips!
On Wed, Jan 11, 2012 at 11:08 AM, blcooley wrote:
>
>
> On Jan 10, 12:03 pm, Erlis Vidal wrote:
> > Hi,
> >
> > I'm solving the following exercise and when I'm trying to use the answer:
> >
> > #(reduce + (for [x coll] 1))
> >
> > I get the error saying that I
On Jan 10, 12:03 pm, Erlis Vidal wrote:
> Hi,
>
> I'm solving the following exercise and when I'm trying to use the answer:
>
> #(reduce + (for [x coll] 1))
>
> I get the error saying that I was using "count" which I'm not. Someone
> knows why is that? Is this a bug in 4Clojure or something in t
Try using map instead -
(fn [s] (reduce + (map (fn [_] 1) s)))
Or even better -
(fn [s] (reduce (fn [x _] (inc x)) 0 s))
Regards,
BG
On Tue, Jan 10, 2012 at 11:33 PM, Erlis Vidal wrote:
> Hi,
>
> I'm solving the following exercise and when I'm trying to use the answer:
>
> #(reduce + (for [x
>
> I'm solving the following exercise and when I'm trying to use the answer:
>>
>> #(reduce + (for [x coll] 1))
>>
>> I get the error saying that I was using "count" which I'm not. Someone
>> knows why is that? Is this a bug in 4Clojure or something in the language
>> that I cannot see?
>>
>>
If o
I did an small mistake in the previous email but it's irrelevant I get the
same result.
the function should be
#(reduce + (for [x %] 1))
Thanks,
Erlis
On Tue, Jan 10, 2012 at 1:03 PM, Erlis Vidal wrote:
> Hi,
>
> I'm solving the following exercise and when I'm trying to use the answer:
>
> #(
16 matches
Mail list logo