我开始阅读Little Schemer了,而不是PLT Scheme,我们有Racket.我想知道Racket是否适合在本书中进行练习,或者我是否需要获得另一个真正的Scheme编译器.在我忘了告诉你之前,我的操作系统是Windows x64.
书,语言和范例足够复杂,我希望避免与编译器挣扎.
非常感谢提前.
我知道C#,但我很难理解一些基本的(我认为)概念,比如信号.
我花了一些时间寻找一些例子,即使在这里也没有运气.也许一些例子或一个真实的简单场景会很好理解它.
在下面的代码中,底层代码是否包含对Foo类型的未命名变量实例的硬引用,或者是易受垃圾回收影响的项目?
using(new Foo())
{
    // Something done here.
}
收集的项目只是一个信号量类型对象,它对资源执行一些引用计数,因此它不会在代码块中引用.
NHibernateSessionManager.Instance.GetSessionFrom(SessionFactoryConfigPath).Flush();
我明白了
null id in FoodOrder.Core.Entities.Articles entry (don't flush the Session after an exception occurs)
我可以使用try catch和session.Close或在这个例子中做什么更好?
例
public void CommitChanges()
        {
            if (NHibernateSessionManager.Instance.HasOpenTransactionOn(SessionFactoryConfigPath))
            {
                NHibernateSessionManager.Instance.CommitTransactionOn(SessionFactoryConfigPath);
            }
            else
            {
                try
                {
                    // If there's no transaction, just flush the changes
                    NHibernateSessionManager.Instance.GetSessionFrom(SessionFactoryConfigPath).Flush();
                }
                finally
                {
                    NHibernateSessionManager.Instance.GetSessionFrom(SessionFactoryConfigPath).Close();
                }
            }
        }