From: Rick DeNatale Date: 2008-02-12T21:09:39+09:00 Subject: Re: how to say # in ruby On 2/11/08, Gerry Ford wrote: > Robert Klemme wrote: > > I'm not sure what you're at here. You posted code from the Ruby > > interpreter but the magical bit of shebang is done by the shell or OS > > not Ruby. See for example: > > > > http://www.google.com/codesearch?hl=de&q=+lang:c+package:kernel+%22%23!%22+show:BxIe8bIKbEg:X-2Nm3hrV4s:RaABaUcqtps&sa=N&cd=2&ct=rc&cs_p=http://kernel.org/pub/linux/kernel/v2.4/linux-2.4.34.1.tar.bz2&cs_f=linux-2.4.34.1/fs/binfmt_script.c > > Thanks for your continued attention, robert. That link was very > interesting. (Ich hatte google noch nie auf deutsch gesehen.) One > snippet I found there was this one: > > 288: { > printk( " no PCI bus?@#!\n"); > return NumberOfAdapters; > > This has #! looking very uncommentlike. Is #! a token separate from # ? > (Does ruby have tokens at all?) Well the link that Robert posted was to some C code, so it shouldn't be expected to give much insight into Ruby syntax/lexing. Note that there ARE cases in Ruby where a # does not start a comment, for example, it is used tor interpolation in string and regular expression 'literals' a = "Foo" puts "The value of a is #{a}" "Foo Fighters".match(/#{a)/) And of course a # inside of string or regexp doesn't start a comment even if it isn't triggering interpolation. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/