Cpp suggestions - #741
Open
asarhaddon wants to merge 19 commits into
Open
Conversation
Compute system name with only one subprocess. Use predefined Make rules and variables when possible. Keep *FLAGS from the environment or command line. Allow the Make command line to override for example the -O option. Split LDLIBS from LDFLAGS and CPPFLAGS from CXXFLAGS. Pass compiler flags to the linker (this is necessary for -Og, safe otherwise).
Best viewed with `git diff -b`, only the indentation changes. This will help when applying the same patch to each step.
In steps8A, unique_ptr was forgotten during the EVAL/macroexpand merge. Simply remove the dynamic allocation.
Minimize the .h interface. Drop unused C headers. Avoid C++ strings for encapsulated manipulations. Only write once the history at program exit. Add a macro producing debug information. Report errors with the history file (but do not crash tests for that). Create it when it is missing.
Remove the confusing NULL env work-around from EVAL. Copy integer operations from step2 to step3 so step3 does not require Core.
Merge rep and safeRep. FIX: errors during the non-interactive startup are now reported. Move the implementation of value_cast<T> from Types.h to .cpp so that it can see all headers. Remove the confusing malEmptyInputException. Simplify try* accordingly.
Ensure that Types does not need Environmen for steps 12. * Remove the dependency on EVAL (which differs between steps23). * Embed a closure into malLambda. * Move symbol evaluation to steps (it differs between steps 23). * Add an fmap function to malVector and malHash. * Remove malLambda::makeEnv because its implementation needs to call a malEnv function (the constructor).
Move implementations from Types.h to .cpp so that they are not compiled on each inclusion. Encapsulate the representation of maps, and change it from binary trees to hash maps. Avoid a level of reference in sequences (like for maps) and remove the last explicit destructor. Also make them mutable and improve encapsulation. Merge both isEqual functions. Merge both withMeta functions. Add optional override qualifiers, only mark as virtual the methods intended for override.
This fixes the memory leaks caused by cycles like (let* [f (fn* [] nil)] nil)
asarhaddon
force-pushed
the
cpp-suggestions
branch
from
August 26, 2026 18:15
4c83361 to
d8f0ef5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello. Here are some suggestions for the c++ implementation.