Re: [isabelle] No tail-recursive code equation for List.map



>> So, if there will be a tail-recursive code equation for List.map in
>> the default library, please only activate it on languages which
>> really profit from tail-recursion.
> 
> 
> Is it possible to enable code equations only for certain target
> languages?

Here is at least one possible solution:

consts scala :: bool
code_const scala
  (Haskell "False")
  (Scala "true")
  (SML "false")
  (OCaml "false")
  (Eval "false")

(* tail recursive variant for Scala to reduce Stack-size at the cost of double traversion *)
definition
  remove_comments :: "string => string"
where
  "remove_comments = (if scala then rev o (remove_comments_tail_rec []) else remove_comments_standard)"

Kind regards,
René



This archive was generated by a fusion of Pipermail (Mailman edition) and MHonArc.