attr?

check if given attribute exists


Parameters

attr? name :string :literal

Returns

  • :logical

Examples

copy
greet: function [x][ switch attr? 'later -> ~"|x| I'm afraid, I'll greet you later" -> ~"Hello, |x|!" ] greet "John" ; => Hello, John! greet.later "John" ; => John I'm afraid, I'll greet you later! ; Have in mind that `attr?` won't pop your attribute's stack greet "Joe" ; => Joe I'm afraid, I'll greet you later!

Related