All Questions

25
votes
5answers
48143 views

Header guards in C++

At LearnCpp.com | 1.10 — A first look at the preprocessor. Under Header guards, there are those code snippets: add.h: #include "mymath.h" int add(int x, int y); subtract.h: #include "mymath.h" ...
154
votes
8answers
53527 views

Unresolved specs during Gem::Specification.reset:

When launching Guard, I'm getting this output: $ guard WARN: Unresolved specs during Gem::Specification.reset: lumberjack (>= 1.0.2) ffi (>= 0.5.0) WARN: Clearing out unresolved spe...
5
votes
1answers
224 views

When did `guard let foo = foo` become legal?

Back in November of 2016 I posted a question asking why I couldn't use guard to create an unwrapped version of a variable using the same name as the optional, like you can with if let: Link: Why i...
7
votes
2answers
830 views

Can I make my own Guards in Erlang?

I came accross this code on the web: is_char(Ch) -> if Ch < 0 -> false; Ch > 255 -> false; true -> true end. is_string(Str) -> ...
6
votes
1answers
1882 views

Tests do not run when file changes with Guard and rspec on windows

I've installed the guard-rspec gem for use in my rails application. When I start up guard from the command line via bundle exec guard, it runs my entire test suite the first time with no problem. ...
5
votes
1answers
7088 views

Swift: Nil is incompatible with return type String

I have this code in Swift: guard let user = username else{ return nil } But I'm getting the following errors: Nil is incompatible with return type String Any of you knows why or how ...
9
votes
1answers
4402 views

Why comparing function results is an illegal guard exception in Erlang?

Why is it illegal? min1_e_( F, X, E) -> if F( X + 2*E ) < F( X + E ) -> % ? min1_e_( F, X, E*2 ); true -> E end. I mean, if I define b...
6
votes
4answers
6142 views

How can I clean my database between erroneous rspec specs?

I have added the database_cleaner gem to my rails application in order to clean my database between specs. Here's my current configuration for database_cleaner, located in spec/spec_helper.rb: con...
6
votes
5answers
2486 views

How do you get cucumber/guard to filter on tags like @wip?

I'm running spork and guard and all has been going very well with my RSpec tests which were all run correctly. In order to speed up the tests I could successfully filter my RSpec tests with tags I pla...
1
votes
1answers
203 views

Reloading Guardfile on changes to files other than the Guardfile

Currently, Guard::Setuper reloads just the Guardfile when it changes. I'm loading some additional code into my guard file (via require), and I'd like to also reload when some of those required files ...

Previous Next