Skip to main content

Timeline for Basic misunderstanding of Begin

Current License: CC BY-SA 3.0

14 events
when toggle format what by license comment
Apr 13, 2017 at 12:55 history edited CommunityBot
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Sep 13, 2016 at 13:56 comment added rcollyer @Szabolcs Here's the relevant table in the docs which describes it, and it also discusses how to reference relative contexts, which can be useful. However, as you point out, the last item should read: "a symbol found in the current context path, or local context".
Sep 13, 2016 at 13:43 comment added Szabolcs @rcollyer That would be worth an answer if the question weren't closed! I didn't know this.
Sep 13, 2016 at 13:38 comment added rcollyer @Alan a workaround is to use `f, as it forces f to be in the local context.
Sep 13, 2016 at 12:43 comment added Szabolcs @Alan Yet I don't have all of them and I still get surprises due to small but fundamental changes ... Some of these changes may be fairly arbitrary ...
Sep 13, 2016 at 12:42 comment added Szabolcs @Alan Maybe there was a good reason. What's more annoying that such small but fundamental changes are made from time to time, yet they are almost never documented. For any other programming language such a change would be a major point in the release notes. I see this as a symptom of Wolfram ignoring developers. Mma is meant to be used interactively from a notebook. There's much less support for writing and distributing packages and there's no help for package authors to ensure compatibility with multiple Mathematica versions. I have 5 versions of Mathematica on my computer just for this.
Sep 13, 2016 at 12:39 vote accept Alan
Sep 13, 2016 at 12:39 comment added Alan Presumably the behavior change achieved some goal, but I'm not seeing what it is. One used to be able to safely change context with Begin .. End. Now that seems only to be true relative to an encompassing BeginPackage .. EndPackage. PS "Iiuc" means "If I understand correctly".
Sep 13, 2016 at 12:26 comment added Szabolcs @Alan What does "Iiuc" mean? Whether you should use Begin .. End on their own depends on what you want to achieve ... Any use outside of the standard package structure would be fairly unusual. But I'm sure that there are some good uses for it I just can't think of one right now (at least not one outside BeginPackage ...
Sep 13, 2016 at 12:20 comment added Alan While your answer is simple and helpful, the existing situation is complex and confusing. Iiuc, the behavior I expected matches the current documentation (both online and the documentation that ships with Mma v11) of $ContextPath, and indeed was the actual behavior until v6. Am I correct that due to this behavior change one should effectively never use Begin .. End without nesting it in BeginPackage .. EndPackage?
Sep 13, 2016 at 9:50 comment added Kuba We can do both, with this answer we can mark this topic as a duplicate in future anyway. In case where original one isn't clearly answering OP.
Sep 13, 2016 at 9:48 comment added Szabolcs @Kuba As you wish, I am uncertain. The information there was necessary, but I thought it wasn't quite sufficient ... but then I notice that ilian explained this (very tersely) in this comment, so maybe that would have been enough?
Sep 13, 2016 at 9:46 comment added Kuba So do you think I should retract a close vote?
Sep 13, 2016 at 9:38 history answered Szabolcs CC BY-SA 3.0