Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Looks great. But I wonder why there are platform requirements for what seems to me like pretty basic functions.

In RandomSample.swift:

  // For log(_:) and exp(_:)
  #if canImport(Glibc)
  @_implementationOnly
  import Glibc
  #elseif canImport(Darwin)
  @_implementationOnly
  import Darwin
  #endif

1. Why aren't those 'basic' functions already implemented in swift, and part of a math package (or in numerics)?

2. Why release a package that does not support windows now that windows is officially supported?



They _are_ in Numerics (including Windows support). I think Nate is just trying to keep dependencies to a minimum, but feel free to raise an issue.


Swift blog also has enough of such examples right on the introduction.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: