using Ela;
using Ela.Compilation;
using Ela.Linking;
using Ela.Runtime;
using Ela.Runtime.ObjectModel;
Thanks!
Alexey
--
---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks Alexey! The document is corrected.
Alexey,
Actually the problem is deeper than I thought. This is clearly a bug. For now I can recommend you to use ‘where’ binding like so:
qsort [] = []
qsort (x::xs) = lessThan ++ [x] ++ notLessThan
where lessThan = section (<)
notLessThan = section (>=)
section pred = qsort [y \\ y<-xs | y `pred` x]
It works as expected.
От: ela...@googlegroups.com [mailto:ela...@googlegroups.com] От имени Tikhonov Alexey
Отправлено: 14 ноября 2013 г. 9:38
Кому: ela...@googlegroups.com
Тема: Re: Embedded Ela documentation - update is needed
Hi!
I tried to rearrange the "quick sort" algorithm in such a way:
qsort [] = []
// Using let-in form:
qsort (x::xs) = let lessThan = section (<)
notLessThan = section (>=)
section pred = qsort [y \\ y<-xs | y `pred` x]
in lessThan ++ [x] ++ notLessThan
//Using where form:
/*qsort (x::xs) = lessThan ++ [x] ++ notLessThan where
lessThan = section (<)
notLessThan = section (>=)
section pred = qsort [y \\ y<-xs | y `pred` x]*/
qsort [2,1,6,1,6,8]
I see the message: "A conflicting definition of 'qsort'" If I toggle comments turning on the second variant, it works. Why does it happen?
Alexey