-
Notifications
You must be signed in to change notification settings - Fork 46
Added object() in cheat sheet for snapshot #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,10 +167,20 @@ <h2>Lists</h2> | |
<article> | ||
<h2>Objects</h2> | ||
<dl> | ||
<dt><code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General#Objects">var = object(…,object,…);</a></code></dt> | ||
<dd> copy</dd> | ||
<dt><code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General#Objects">var = object(…,name=value,…);</a></code></dt> | ||
<dd> assign/override</dd> | ||
<dt><code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General#Objects_edits">var = object(…,[…,["name"],…],…);</a></code></dt> | ||
<dd> remove name</dd> | ||
<dt><code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General#Objects_edits">var = object(…,[…,["name",value],…],…);</a></code></dt> | ||
<dd> add name=value</dd> | ||
Comment on lines
+170
to
+177
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opinions solicited: There is an argument that this and
Comment on lines
+170
to
+177
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Futures: I have mixed feelings about the It's certainly fine for now. We should also work on consistency in how argument names are presented; we have cases where they are plain text, are part of the link or not, are gray, are italics. We have most functions not mentioning their arguments, but a couple do. But Not This Project. |
||
<dt><code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General#Objects">var = obj["name"];</a></code></dt> | ||
<dd> get value from object by string</dd> | ||
<dd> get value from object by name</dd> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discuss: Hmm. Using "string" there was deliberate, to emphasize that it was an arbitrary string expression, as opposed to an limited-to-identifier-and-constant name for the next. |
||
<dt><code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General#Objects">var = obj.name;</a></code></dt> | ||
<dd> get value from object by identifier</dd> | ||
<dt><code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General#Has_key">has_key(object,"name");</a></code></dt> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change: anchors for other functions are in lower case. |
||
<dd> </dd> | ||
</dl> | ||
</article> | ||
<article> | ||
|
@@ -212,6 +222,8 @@ <h2>Type test functions</h2> | |
<code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Type_Test_Functions#is_function">is_function</a></code> | ||
<code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Type_Test_Functions#is_object">is_object</a></code> | ||
</article> | ||
</section> | ||
<section> | ||
Comment on lines
+225
to
+226
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Undo: I wouldn't make this particular change, especially as part of this project. Having "Functions" be at the top of a column seems right; burying it under "Other" seems wrong. On the other hand, I don't know why "Type test functions" is before Functions; I'd move it over to after "Functions" or after "Mathematical". But again, Not This Project. |
||
<article> | ||
<h2>Other</h2> | ||
<code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#echo">echo</a>(…)</code> | ||
|
@@ -220,9 +232,6 @@ <h2>Other</h2> | |
<code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#assert">assert</a>(condition, message)</code> | ||
<s><code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Conditional_and_Iterator_Functions#Assign_Statement">assign</a> (…) { … }</code></s> | ||
</article> | ||
</section> | ||
|
||
<section> | ||
<article> | ||
<h2>Functions</h2> | ||
<code><a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Mathematical_Functions#concat">concat</a></code> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation: I would order these as
because I think name=value is the most likely variant.