[Rock-dev] How to explicit assign task ports to service ports?

Matthias Goldhoorn matthias.goldhoorn at dfki.de
Wed Sep 4 11:16:21 CEST 2013


On 04.09.2013 10:50, Sylvain Joyeux wrote:
> On 09/04/2013 10:49 AM, Matthias Goldhoorn wrote:
>>> The "pattern matching" operator in Ruby is ===, so you can replace
>>>
>>> +                    if port_name.kind_of?(Regexp)
>>> +                        res = p_name !~ port_name
>>> +                    else
>>> +                        res = p_name != port_name
>>> +                    end
>>>
>>> by
>>>
>>> res = (port_name === p_name)
>> I specially want to handle RegularExpressions differently than strings
>> to keep the possibility to use the RegExp witin this function.
>> Handly everything as a RegExp causes the error above.
>>
>> http://www.ruby-doc.org/core-1.9.3/String.html#method-i-3D-3D-3D
>>
>> mention that == and === are equal?!
> For strings. For regular expressions, it regex === str is equivalent to
> str =~ regex. Which is why you can do what I suggested ;-)
>
Then i will push the attached on, but i prefer !(port_name === p_name) 
in this case ;) (with the explanation mark before to become equal)

Matthias

-- 
  Dipl.-Inf. Matthias Goldhoorn
  Space and Underwater Robotic

  Universität Bremen
  FB 3 - Mathematik und Informatik
  AG Robotik
  Robert-Hooke-Straße 5
  28359 Bremen, Germany

  Tel.:     +49 421 178 45-4193
  Zentrale: +49 421 178 45-6550
  Fax:      +49 421 178 45-4150
  E-Mail:   matthias.goldhoorn at uni-bremen.de

  Weitere Informationen: http://www.informatik.uni-bremen.de/robotik

-------------- nächster Teil --------------
Ein Dateianhang mit Bin?rdaten wurde abgetrennt...
Dateiname   : 0001-find_port-only-find-ports-where-the-name-match-if-no.patch
Dateityp    : text/x-patch
Dateigr??e  : 0 bytes
Beschreibung: nicht verf?gbar
URL         : http://www.dfki.de/pipermail/rock-dev/attachments/20130904/f4af6aff/attachment-0001.bin 


More information about the Rock-dev mailing list