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

> Or, do you just not do that sort of stuff in these languages?

i tell you more. it is very much recommended to avoid doing this sort of stuff in all languages.

  v_sepallength: 11 14 12
  v_sepallthickness: 1.3 1.5 1.2
  mul[v_sepallength;v_sepalthickness]
no:

   /sepal:lengths and stroke widths
   spl:[l:11 14 12;w:1.3 1.5 1.2]    /this is your "struct", if you will
  
   spl.w
  1.3 1.5 1.2    /proof

   */spl
  14.3 21. 14.4  /for mul, we don't even have to bother with field names

   */spl`l`w     /but if you insist, lets make it explicit
  14.3 21. 14.4

to produce a "factory" for well-formed spl objects is a no-brainer as well.

why we don't use v_ prefix:

  1. everything what can be a vector should be a vector.
  2. we can't use underscore anyway - it is an operator.


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

Search: