-
Thoroughly enjoying yarn 3! And trying to enjoy constraints (I’m totally new to prolog but find it pretty cool. It’s like math). I'm almost there (I think), I just needed a little help. The constraint I want to write is “a dependency shouldn’t have a caret”; a better way to say it may be “dependencies should be static”. Regardless, what I’ve got so far is:
This lists all the dependencies that have a caret, like…
Since I got something to work with gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType)
workspace_has_dependency(WorkspaceCwd, DependencyRange, DependencyType),
atom_concat(‘^’, _, DependencyRange) But that doesn't seem to be working. 🤔 Appreciate any help; thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The query you included doesn't seem to match what you ran as you're missing a
Ignoring that, you need to store the result from gen_enforced_dependency(WorkspaceCwd, DependencyIdent, TargetDependencyRange, DependencyType) :-
workspace_has_dependency(WorkspaceCwd, DependencyIdent, CurrentDependencyRange, DependencyType),
atom_concat('^', TargetDependencyRange, CurrentDependencyRange). https://www.swi-prolog.org/pldoc/man?predicate=atom_concat/3 |
Beta Was this translation helpful? Give feedback.
The query you included doesn't seem to match what you ran as you're missing a
DependencyIdent
so you should be getting this errorIgnoring that, you need to store the result from
atom_concat
to an atom thatgen_enforced_dependency
can use to set the new range