![]() The random-normal reporter is no longer broken as it was in v2.10.0.The random-exponential reporter is now properly checked for runtime errors.The major feature in this release is the ability to jump to the exact primitive in the code tab that causes a runtime error. Saving a model to an nlogo file with a plot with blank axes names correctly sets the values to NIL so the file can be loaded without errors.Using a variable argument primitive like word concisely with reduce would give incorrect results.When you display an anonymous procedure as a string, it will include the names of let variables.The range primitive will work when using the three-argument version.The initial random-number generator seeds are now taken from the Crypto Web API, which should eliminate the chance multiple users can wind up with the same seed when they load a page.This is a small release to fix a few different bugs. It also includes some changes to NetTango Web, including syntax highlighting in block code tips. Deleting a plot could cause unrecoverable errors.The Commands and Code position setting can now be determined by a URL query parameter when linking to NetLogo Web models.To get image data in base64 format into a NetLogo Web model for use by the Bitmap extension with bitmap:from-base64, see the Fetch extension. The Bitmap extension is now supported.That said, there could be unintended consequences, so further testing and benchmarking are needed.This is a small release with bugfixes and features. Benchmarking has shown no performance impact, both on micro benchmarks as well as real models. Note that the above variadicity is accomplished by having them take anonymous procedures instead of blocks. Assuming there are no problems that arise, move the change into the core language at a significant version change (major or minor, not point).Replace the current primitives in cf with the generalized ifelse and ifelse-value to test the syntaxes and let people start using them as soon as possible.The change to ifelse-value does break backwards compatibility, but affects a very limited number of models (1 in the models library and 3 on the modeling commons) and should be auto-convertible. That said, this is a substantial change to ifelse with a very hard break in forwards compatibility (new models wouldn't work in old version of NetLogo). In addition to generalizing ifelse and ifelse-value, we would change the associativity of ifelse-value in accordance with #588. We had been discussing add a new primitive with that syntax, but the fact that the syntax is just a generalization of ifelse pushed us towards generalizing ifelse. ![]() ![]() The default number of arguments would be 3, so current ifelse would continue to work. (If the only easy way to add cond involves lots of brackets, why not offer a many-bracket version at first, with the possibility of adding a cleaner syntactically sugared version later?)Īs for cond-value, that will be used less often than a procedural cond, I suspect, so if it's extra trouble to implement cond-value, it could wait-though it would be useful. I agree that since cond is more general, that would be the first that should be implemented, even though it's less common than case outside of the Lisp-ey world. And I would think cond or case would be easy to implement once a decision has been made on syntax. I think we'd all like to have something that allows avoiding embedded if-elses. Still, anyone who's done more than trivial NetLogo programming has wanted a case or cond at some point. Is the only thing holding back implementation of cond or case disagreement about syntax? I understand that syntax has to be thought through, since it has long-term impacts. ![]() This reads less well then else however, so you could also just special case the last argument to be the else argument, thus matching ifelse. The "else" argument falls out naturally since you can just make the last pair start with true (as shown). You could make the conditionals reporter blocks to get around that, but I don't personally think it's a worth it. The drawback is that every conditional would be evaluated (or rather, the syntax implies that). cond would just run the command block after the first true argument. The arguments would be alternating booleans and command blocks. It'd just be a function that takes in a variable number of arguments. This seems more NetLogo-y to me, as it matches the syntax for if and ifelse, and is quite clean. True ) or maybe drop the true and special case the last argument
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |