File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
name = " Constraints"
2
2
uuid = " 30f324ab-b02d-43f0-b619-e131c61659f7"
3
3
authors = [" Jean-François Baffier" ]
4
- version = " 0.5.0 "
4
+ version = " 0.5.1 "
5
5
6
6
[deps ]
7
7
CompositionalNetworks = " 4b67e4b5-442d-4ef5-b760-3f5df3a57537"
Original file line number Diff line number Diff line change @@ -78,6 +78,13 @@ function make_error(symb::Symbol)
78
78
return (x; params... ) -> Float64 (! eval (Symbol (" concept_$symb " ))(x; params... ))
79
79
end
80
80
81
+ """
82
+ shrink_concept(s)
83
+
84
+ Simply delete the `concept_` part of symbol or string starting with it. TODO: add a check with a warning if `s` starts with something different.
85
+ """
86
+ shrink_concept (s) = Symbol (string (s)[9 : end ])
87
+
81
88
# # SECTION - Test Items
82
89
@testitem " Empty constraint" tags = [:constraint , :empty ] begin
83
90
c = Constraint ()
Original file line number Diff line number Diff line change 46
46
macro usual (ex:: Expr )
47
47
# Symbol of the concept, for instance :all_different
48
48
s = ex. args[1 ]. args[1 ]
49
- c = Symbol ( string (s)[ 9 : end ] )
49
+ c = shrink_concept (s )
50
50
51
51
# Dict storing the existence or not of a default value for each kwarg
52
52
defaults = Dict {Symbol, Bool} ()
You can’t perform that action at this time.
0 commit comments