-
Notifications
You must be signed in to change notification settings - Fork 173
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
some fixes #1308
some fixes #1308
Changes from 7 commits
f952c8a
a859817
ecd6751
b6b29aa
25a7966
3efa93e
f3bb1b0
191f2c2
ec28857
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 |
---|---|---|
|
@@ -393,11 +393,14 @@ std::string ObjectFileDB::generate_obj_listing(const std::unordered_set<std::str | |
result += "[\"" + pad_string(name + "\", ", 50) + "\"" + | ||
pad_string(x.name_in_dgo + "\", ", 50) + std::to_string(x.obj_version) + ", " + | ||
dgos + ", \"\"],\n"; | ||
unique_count++; | ||
if (all_unique_names.find(name) != all_unique_names.end() && | ||
merged_objs.find(name) == merged_objs.end()) { | ||
lg::error("Object file {} appears multiple times with the same name.", name); | ||
} | ||
if (merged_objs.find(name) == merged_objs.end() || | ||
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. thanks for fixing this |
||
all_unique_names.find(name) == all_unique_names.end()) { | ||
unique_count++; | ||
} | ||
all_unique_names.insert(name); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -438,16 +438,23 @@ | |
) | ||
) | ||
|
||
(defmacro swhen (condition &rest body) | ||
"Same as when, but saves the branch condition onto a variable named bc" | ||
(defmacro aif (condition true false) | ||
"Anaphoric if, similar to Common Lisp" | ||
|
||
`(let ((bc ,condition)) | ||
(if bc | ||
(begin ,@body) | ||
`(let ((it ,condition)) | ||
(if it | ||
,true | ||
,false | ||
) | ||
) | ||
) | ||
|
||
(defmacro awhen (condition &rest body) | ||
"Anaphoric when, similar to Common Lisp" | ||
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. 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. Lol, this is what I found first http://community.schemewiki.org/?anaphoric-if 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. (I don't think "anaphoric when" is a lisp thing, only "anaphoric if", so I'm kind of cheating) |
||
|
||
`(aif ,condition (begin ,@body) #f) | ||
) | ||
|
||
(defmacro return (val) | ||
`(return-from #f ,val) | ||
) | ||
|
@@ -460,7 +467,8 @@ | |
|
||
(defmacro case (switch &key (comp =) &rest cases) | ||
"A switch-case construct. switch is saved onto a local variable and compared against each case, sequentially. | ||
else can be used like the 'default' case, but it must be the last one." | ||
else can be used like the 'default' case, but it must be the last one. | ||
comp is the function to use when evaluating the clauses. It can be any valid head of a form (operator or call)." | ||
|
||
(with-gensyms (sw) | ||
;; save the switch to a variable (only evaluated once) | ||
|
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.
I think I have a better fix for this. There's a silly bug so it resizes on every addition 🤦♂️
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.
but this is fine for now