Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
surprising immigrate behavior (?)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Stuart Halloway  
View profile  
 More options Oct 5 2009, 11:11 am
From: Stuart Halloway <stuart.hallo...@gmail.com>
Date: Mon, 5 Oct 2009 11:11:27 -0400
Local: Mon, Oct 5 2009 11:11 am
Subject: surprising immigrate behavior (?)
A consequence of using immigrate is that vars intended for rebinding  
show up in multiple namespaces, and you have to be careful to get the  
right one:

(use 'compojure)

; surprise: *errors* appear unbound!
(binding [*errors* {:foo "bar"}] ((error-class text-field) :foo))
= > [:input {:type "text", :name "foo", :id "foo"}]

; correct binding (different var!)
(binding [compojure.validation/*errors* {:foo "bar"}] ((error-class  
text-field) :foo))
=> [:div.error [:input {:type "text", :name "foo", :id "foo"}]]

This is logical, given how immigrate works, but it still feels weird--
and it forces you to poke around in the "real" namespaces sometimes.

Is this a feature or a bug?

Stu


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Renfer  
View profile  
 More options Oct 5 2009, 11:58 am
From: Daniel Renfer <d...@kronkltd.net>
Date: Mon, 5 Oct 2009 11:58:07 -0400
Local: Mon, Oct 5 2009 11:58 am
Subject: Re: surprising immigrate behavior (?)
This is one of the very reason that I refuse to use any immigrated
namespaces in my own application. I got sick of seeing multiple copies
of vars because I used different levels of immigration all over the
place.

Don't get me wrong. The immigration is great for the simple case where
you can just require compojure and go, but IMO, it's better to use the
real namespaces when possible.

On Mon, Oct 5, 2009 at 11:11 AM, Stuart Halloway


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Carper  
View profile  
 More options Oct 5 2009, 5:01 pm
From: Brian Carper <briancar...@gmail.com>
Date: Mon, 5 Oct 2009 14:01:15 -0700 (PDT)
Local: Mon, Oct 5 2009 5:01 pm
Subject: Re: surprising immigrate behavior (?)
On Oct 5, 8:58 am, Daniel Renfer <d...@kronkltd.net> wrote:

> Don't get me wrong. The immigration is great for the simple case where
> you can just require compojure and go, but IMO, it's better to use the
> real namespaces when possible.

I must agree... I gave up on (use 'compojure) and friends and I refer
to the namespaces explicitly everywhere.  The behavior was too
unpredictable.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Reeves  
View profile  
 More options Oct 5 2009, 7:32 pm
From: James Reeves <weavejes...@googlemail.com>
Date: Mon, 5 Oct 2009 16:32:21 -0700 (PDT)
Local: Mon, Oct 5 2009 7:32 pm
Subject: Re: surprising immigrate behavior (?)
On Oct 5, 11:11 am, Stuart Halloway <stuart.hallo...@gmail.com> wrote:

> This is logical, given how immigrate works, but it still feels weird--
> and it forces you to poke around in the "real" namespaces sometimes.

> Is this a feature or a bug?

I'm tempted to remove the immigrated namespaces altogether. They're
nice for "hello world" examples, but they can lead to unintuitive
behaviour.

- James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vagif Verdi  
View profile  
 More options Oct 8 2009, 4:23 pm
From: Vagif Verdi <vagif.ve...@gmail.com>
Date: Thu, 8 Oct 2009 13:23:06 -0700 (PDT)
Local: Thurs, Oct 8 2009 4:23 pm
Subject: Re: surprising immigrate behavior (?)

On Oct 5, 4:32 pm, James Reeves <weavejes...@googlemail.com> wrote:

> I'm tempted to remove the immigrated namespaces altogether. They're
> nice for "hello world" examples, but they can lead to unintuitive
> behaviour.

How about a macro (use-group compojure) That will add a bunch of
defined uses ?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »