Comments by "" (@laughingvampire7555) on "Developer Voices"
channel.
-
5
-
4
-
4
-
3
-
3
-
2
-
2
-
2
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
you should invite someone who does Dylan, Dylan is a classic of the Lisp community, is the one Lisp with Meta-expressions, well until Wolfram Language appeared which is also a Lisp with M-exps but Dylan is the example that every lisper knows. It was made by Apple to work with the Newton and is derived from both Scheme and Common Lisp. Here is an example of code of Dylan
module quicksort;
define function quicksort(list)
if length(list) <= 1 then
return list;
end if;
let pivot = first(list);
let rest = rest(list);
let smaller = sublist(rest, element <= pivot);
let larger = sublist(rest, element > pivot);
return concatenate(quicksort(smaller), {pivot}, quicksort(larger));
end function;
define function sublist(list, predicate)
let result = [];
for each (element in list)
if predicate(element) then
result := result & {element};
end if;
end for;
return result;
end function;
define function main()
let unsorted = {34, 7, 23, 32, 5, 62};
let sorted = quicksort(unsorted);
format-out("Sorted list: ~a~%", sorted);
end function;
end module;
1
-
1
-
1
-
1