Reloading module doesn't redefine constant

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Reloading module doesn't redefine constant

Kevin Liu-2
Help! (see attachment)

Screen Shot 2016-11-14 at 21.35.35.png (306K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Kevin Liu-2


On Monday, November 14, 2016 at 10:36:07 PM UTC-2, Kevin Liu wrote:
Help! (see attachment)

Screen Shot 2016-11-14 at 22.38.37.png (139K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Yichao Yu
On Mon, Nov 14, 2016 at 7:39 PM, Kevin Liu <[hidden email]> wrote:
>
>
> On Monday, November 14, 2016 at 10:36:07 PM UTC-2, Kevin Liu wrote:
>>
>> Help! (see attachment)

This is not related to reloading. You can't have a global variable
with the same name of the module since that's already bound to the
module itself.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Kevin Liu-2
Cool, thanks Yichao. I changed module Factor to module FactorNode. Now I got


TypeError: is defined: expected Symbol, got Type{FactorNode.FactorNode.Factor}


(see attachment)

On Monday, November 14, 2016 at 10:41:43 PM UTC-2, Yichao Yu wrote:
On Mon, Nov 14, 2016 at 7:39 PM, Kevin Liu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="NweB-RS2BgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">kvt...@...> wrote:
>
>
> On Monday, November 14, 2016 at 10:36:07 PM UTC-2, Kevin Liu wrote:
>>
>> Help! (see attachment)

This is not related to reloading. You can't have a global variable
with the same name of the module since that's already bound to the
module itself.

Screen Shot 2016-11-14 at 23.25.18.png (141K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Yichao Yu
On Mon, Nov 14, 2016 at 8:28 PM, Kevin Liu <[hidden email]> wrote:
> Cool, thanks Yichao. I changed module Factor to module FactorNode. Now I got
>
>
> TypeError: is defined: expected Symbol, got
> Type{FactorNode.FactorNode.Factor}

Well, as the error message says, you passed a type
`FactorNode.FactorNode.Factor` instead of a `Symbol` to `isdefined`.
It's unclear what you want to test though given `Factor` was defined
right above.

>
>
> (see attachment)
>
> On Monday, November 14, 2016 at 10:41:43 PM UTC-2, Yichao Yu wrote:
>>
>> On Mon, Nov 14, 2016 at 7:39 PM, Kevin Liu <[hidden email]> wrote:
>> >
>> >
>> > On Monday, November 14, 2016 at 10:36:07 PM UTC-2, Kevin Liu wrote:
>> >>
>> >> Help! (see attachment)
>>
>> This is not related to reloading. You can't have a global variable
>> with the same name of the module since that's already bound to the
>> module itself.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Kevin Liu-2
Thanks. I removed the if statement (see attachment). Does indentation affect `include("FactorOperations.jl")`? If I pull it back to where `module` starts, it says `incomplete module at ... requires end`. Then pushing it under `type` defines `module`. 

On Mon, Nov 14, 2016 at 11:57 PM, Yichao Yu <[hidden email]> wrote:
On Mon, Nov 14, 2016 at 8:28 PM, Kevin Liu <[hidden email]> wrote:
> Cool, thanks Yichao. I changed module Factor to module FactorNode. Now I got
>
>
> TypeError: is defined: expected Symbol, got
> Type{FactorNode.FactorNode.Factor}

Well, as the error message says, you passed a type
`FactorNode.FactorNode.Factor` instead of a `Symbol` to `isdefined`.
It's unclear what you want to test though given `Factor` was defined
right above.

>
>
> (see attachment)
>
> On Monday, November 14, 2016 at 10:41:43 PM UTC-2, Yichao Yu wrote:
>>
>> On Mon, Nov 14, 2016 at 7:39 PM, Kevin Liu <[hidden email]> wrote:
>> >
>> >
>> > On Monday, November 14, 2016 at 10:36:07 PM UTC-2, Kevin Liu wrote:
>> >>
>> >> Help! (see attachment)
>>
>> This is not related to reloading. You can't have a global variable
>> with the same name of the module since that's already bound to the
>> module itself.


Screen Shot 2016-11-15 at 01.26.21.png (229K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Kevin Liu-2
Also, now `function FactorPermute(A::Factor, v::Vector{Int})` won't define, throws

TypeError: Tuple: in parameter, expected Type{T}, got Module

(see attachment)

Do I `include("Factor.jl") before `function FactorPermute()`?



On Tue, Nov 15, 2016 at 1:35 AM, Kevin Liu <[hidden email]> wrote:
Thanks. I removed the if statement (see attachment). Does indentation affect `include("FactorOperations.jl")`? If I pull it back to where `module` starts, it says `incomplete module at ... requires end`. Then pushing it under `type` defines `module`. 

On Mon, Nov 14, 2016 at 11:57 PM, Yichao Yu <[hidden email]> wrote:
On Mon, Nov 14, 2016 at 8:28 PM, Kevin Liu <[hidden email]> wrote:
> Cool, thanks Yichao. I changed module Factor to module FactorNode. Now I got
>
>
> TypeError: is defined: expected Symbol, got
> Type{FactorNode.FactorNode.Factor}

Well, as the error message says, you passed a type
`FactorNode.FactorNode.Factor` instead of a `Symbol` to `isdefined`.
It's unclear what you want to test though given `Factor` was defined
right above.

>
>
> (see attachment)
>
> On Monday, November 14, 2016 at 10:41:43 PM UTC-2, Yichao Yu wrote:
>>
>> On Mon, Nov 14, 2016 at 7:39 PM, Kevin Liu <[hidden email]> wrote:
>> >
>> >
>> > On Monday, November 14, 2016 at 10:36:07 PM UTC-2, Kevin Liu wrote:
>> >>
>> >> Help! (see attachment)
>>
>> This is not related to reloading. You can't have a global variable
>> with the same name of the module since that's already bound to the
>> module itself.



Screen Shot 2016-11-15 at 01.38.24.png (253K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Yichao Yu
In reply to this post by Kevin Liu-2
On Mon, Nov 14, 2016 at 10:35 PM, Kevin Liu <[hidden email]> wrote:
> Does indentation affect `include("FactorOperations.jl")`? If I pull it back

No.

> to where `module` starts, it says `incomplete module at ... requires end`.
> Then pushing it under `type` defines `module`.

Unclear what you mean.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Yichao Yu
In reply to this post by Kevin Liu-2
On Mon, Nov 14, 2016 at 10:47 PM, Kevin Liu <[hidden email]> wrote:
> Also, now `function FactorPermute(A::Factor, v::Vector{Int})` won't define,
> throws
>
> TypeError: Tuple: in parameter, expected Type{T}, got Module
>

Apparently `Factor` is still a module. I have no idea what's the full code.

> (see attachment)
>
> Do I `include("Factor.jl") before `function FactorPermute()`?
>
>
>
> On Tue, Nov 15, 2016 at 1:35 AM, Kevin Liu <[hidden email]> wrote:
>>
>> Thanks. I removed the if statement (see attachment). Does indentation
>> affect `include("FactorOperations.jl")`? If I pull it back to where `module`
>> starts, it says `incomplete module at ... requires end`. Then pushing it
>> under `type` defines `module`.
>>
>> On Mon, Nov 14, 2016 at 11:57 PM, Yichao Yu <[hidden email]> wrote:
>>>
>>> On Mon, Nov 14, 2016 at 8:28 PM, Kevin Liu <[hidden email]> wrote:
>>> > Cool, thanks Yichao. I changed module Factor to module FactorNode. Now
>>> > I got
>>> >
>>> >
>>> > TypeError: is defined: expected Symbol, got
>>> > Type{FactorNode.FactorNode.Factor}
>>>
>>> Well, as the error message says, you passed a type
>>> `FactorNode.FactorNode.Factor` instead of a `Symbol` to `isdefined`.
>>> It's unclear what you want to test though given `Factor` was defined
>>> right above.
>>>
>>> >
>>> >
>>> > (see attachment)
>>> >
>>> > On Monday, November 14, 2016 at 10:41:43 PM UTC-2, Yichao Yu wrote:
>>> >>
>>> >> On Mon, Nov 14, 2016 at 7:39 PM, Kevin Liu <[hidden email]> wrote:
>>> >> >
>>> >> >
>>> >> > On Monday, November 14, 2016 at 10:36:07 PM UTC-2, Kevin Liu wrote:
>>> >> >>
>>> >> >> Help! (see attachment)
>>> >>
>>> >> This is not related to reloading. You can't have a global variable
>>> >> with the same name of the module since that's already bound to the
>>> >> module itself.
>>
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Kevin Liu-2
In reply to this post by Yichao Yu
This is weird. Please observe include() in the two attachments I've made. 

On Tue, Nov 15, 2016 at 11:37 AM, Yichao Yu <[hidden email]> wrote:
On Mon, Nov 14, 2016 at 10:35 PM, Kevin Liu <[hidden email]> wrote:
> Does indentation affect `include("FactorOperations.jl")`? If I pull it back

No.

> to where `module` starts, it says `incomplete module at ... requires end`.
> Then pushing it under `type` defines `module`.

Unclear what you mean.


Screen Shot 2016-11-15 at 15.04.30.png (367K) Download Attachment
Screen Shot 2016-11-15 at 15.04.17.png (379K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Kevin Liu-2

On Tue, Nov 15, 2016 at 3:05 PM, Kevin Liu <[hidden email]> wrote:
This is weird. Please observe include() in the two attachments I've made. 

On Tue, Nov 15, 2016 at 11:37 AM, Yichao Yu <[hidden email]> wrote:
On Mon, Nov 14, 2016 at 10:35 PM, Kevin Liu <[hidden email]> wrote:
> Does indentation affect `include("FactorOperations.jl")`? If I pull it back

No.

> to where `module` starts, it says `incomplete module at ... requires end`.
> Then pushing it under `type` defines `module`.

Unclear what you mean.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reloading module doesn't redefine constant

Kevin Liu-2
For some reason, now everything just worked. 

On Tuesday, November 15, 2016 at 3:09:07 PM UTC-2, Kevin Liu wrote:
Full code

<a href="https://github.com/hpoit/MLN.jl/blob/master/Factor.jl" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fhpoit%2FMLN.jl%2Fblob%2Fmaster%2FFactor.jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFSGLu-Baizpa-2EeFbfluuQMundw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fhpoit%2FMLN.jl%2Fblob%2Fmaster%2FFactor.jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFSGLu-Baizpa-2EeFbfluuQMundw&#39;;return true;">https://github.com/hpoit/MLN.jl/blob/master/Factor.jl
<a href="https://github.com/hpoit/MLN.jl/blob/master/FactorOperations.jl" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fhpoit%2FMLN.jl%2Fblob%2Fmaster%2FFactorOperations.jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEjlA5MwuNP-7Jve_8uZajfc_RF3w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fhpoit%2FMLN.jl%2Fblob%2Fmaster%2FFactorOperations.jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEjlA5MwuNP-7Jve_8uZajfc_RF3w&#39;;return true;">https://github.com/hpoit/MLN.jl/blob/master/FactorOperations.jl

On Tue, Nov 15, 2016 at 3:05 PM, Kevin Liu <[hidden email]> wrote:
This is weird. Please observe include() in the two attachments I've made. 

On Tue, Nov 15, 2016 at 11:37 AM, Yichao Yu <[hidden email]> wrote:
On Mon, Nov 14, 2016 at 10:35 PM, Kevin Liu <[hidden email]> wrote:
> Does indentation affect `include("FactorOperations.jl")`? If I pull it back

No.

> to where `module` starts, it says `incomplete module at ... requires end`.
> Then pushing it under `type` defines `module`.

Unclear what you mean.


Loading...