FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Gonna break some stuff.

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Fri Apr 01, 2011 11:01 pm    Post subject: Gonna break some stuff. Reply with quote

I'm taking some things out of the language. Perfection is not when no more can be added, but when no more can be taken away.


  • /* */ will now nest, and /+ +/ are being removed. There's no real need to have both. D only has them so copypasting C code will preserve the commenting.
  • The `backtick` verbatim strings are being replaced by new @'at-single-quote' verbatim strings. I don't want to use up an entire character for something that can already be done with @"these", but there is a need for verbatim strings that allow unescaped double quotes (regexps!).
  • Tables will no longer participate in metamethods.
  • Lightweight (non-copying) array slices are going. There's no real need for them, and they only make the implementation trickier.
  • Changing the import renaming syntaxes from "rename = name" to "name as rename". D only chose that syntax to avoid new keywords; 'as' is already a keyword and it reads much more nicely.
  • Remove all but opApply from the table metatable. Generic code can't count on "t.keys()" and such being valid, and even normal code can be bitten by it.
  • hash.set/get are no longer necessary as tables can't have opIndex/Assign metamethods and namespaces never could.
  • Native API funcs idx/a/i no longer need the 'raw' parameter, as the only things that can be indexed don't have a different behavior based on it.
  • Function environments should really be associated with their definitions, and should only be able to be set once, with the first closure. This makes it possible to cache any function closure that doesn't have upvalues, greatly reducing the number of closure allocations.
  • Class allocators/finalizers should only be able to be set once.
  • Reorganizing the source.
  • Dropping curry/bindContext from the baselib. They're really trivial functions.
  • Splitting up/moving around some baselib stuff.


I'll add to this list if I come up with more.
Back to top
View user's profile Send private message
Ligustah



Joined: 21 Oct 2007
Posts: 45
Location: Berlin, Germany

PostPosted: Fri Apr 22, 2011 5:32 am    Post subject: Reply with quote

Why the curry? Crying or Very sad
Will you provide a replacement? Or is there a chance curry will become a core language feature? It may be trivial, but it's a pretty handy thing, especially with stuff like map/reduce.
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Fri Apr 22, 2011 8:33 am    Post subject: Reply with quote

curry is just:

Code:
function curry(f: function, v) = \vararg -> f(with this, v, vararg)


bindContext is:

Code:
function bindContext(f: function, v) = \vararg -> f(with v, vararg)


I may have a "functional" module in the future, but much of the other functional stuff is already in the arraylib. Until then, you can use the above snippets.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group