Coming back to this -- this appears to cause inconsistencies - It is not so 
much that that you can doc a float, but more that the behavior is 
surprising. 



julia> "hello" 2.3
  hello


julia> "hello" (x)->x+1


WARNING: deprecated syntax "hello (".
Use "hello(" instead.
ERROR: syntax: ""hello"(x)" is not a valid function argument name


julia> "hello" z() = 1
z (generic function with 1 method)


julia> "hello" "world"
  hello


julia> "hello" "world" "again"
ERROR: syntax: extra token """ after end of expression


julia> "hello" type foo end


julia> 


julia> function bar()
       "hello" 1.23
ERROR: syntax: extra token "1.23" after end of expression

julia> "hello" x = 2
  hello




On Saturday, October 10, 2015 at 2:04:39 PM UTC-4, Stefan Karpinski wrote:
>
> While it's a bit odd to document numbers, making the criteria for whether 
> something is a doc string or not as simple as possible seems like it may be 
> a good thing, even if this particular instance of the syntax isn't terribly 
> useful.
>
> On Sat, Oct 10, 2015 at 9:47 PM, Isaiah Norton <[email protected] 
> <javascript:>> wrote:
>
>> I agree with MDC Francis that this is kind of odd. Is it common to doc 
>> arbitrary numbers? Supporting this isnt necessary to doc MathConsts...
>>
>> (it also didn't seem to work properly for ints or floats when I tried -- 
>> the doc was added to meta, but help didn't seem to find it).
>> On Oct 10, 2015 11:50 AM, "Michael Hatherly" <[email protected] 
>> <javascript:>> wrote:
>>
>>> If you want to disable the automatic @doc then you can append a ; to 
>>> the string or nest the expressions in a begin ... end block:
>>>
>>> "hello";
>>> 3.142
>>>
>>> begin
>>>     "hello"
>>>     3.142
>>> end
>>>
>>> — Mike
>>> ​
>>>
>>>
>>> On Friday, 9 October 2015 22:02:37 UTC+2, Michael Francis wrote:
>>>>
>>>> Julia 0.4 rc4 
>>>>
>>>> I get the following unexpected (to me) behavior - 
>>>>
>>>> julia> parse( "\"hello\"\n3.142" )
>>>> :(@doc "hello" 3.142)
>>>>
>>>> is this intentional ? 
>>>>
>>>>
>

Reply via email to