F#报价评估问题(F# quotation evaluation issue)
我遇到了F#powerpack报价评估的问题。
open Microsoft.FSharp.Linq.QuotationEvaluation let print x = System.Console.WriteLine(sprintf "%A" x) type record = { x:int; y:int } let val1 = { x = 1; y = 1; } let val2 = { x = 1; y = 1; } let result = val1 = val2 print result let quote = <@ let value1 = { x = 1; y = 1; } let value2 = { x = 1; y = 1; } let result2 = value1 = value2 result2 @> print (quote.EvalUntyped())
第一个结果如你所料那样真实。 第二个是假的。 这是一个错误,还是我错过了什么?
I'm getting an issue with the F# powerpack quotation evaluation.
open Microsoft.FSharp.Linq.QuotationEvaluation let print x = System.Console.WriteLine(sprintf "%A" x) type record = { x:int; y:int } let val1 = { x = 1; y = 1; } let val2 = { x = 1; y = 1; } let result = val1 = val2 print result let quote = <@ let value1 = { x = 1; y = 1; } let value2 = { x = 1; y = 1; } let result2 = value1 = value2 result2 @> print (quote.EvalUntyped())
The first result is true as you would expect. The second is false. Is this a bug, or am I missing something?
原文:https://stackoverflow.com/questions/2344805
最满意答案
你必须运行
$ionicHistory.clearCache();
在用户注销时在您的控制器中。 这将清除用户的所有视图缓存。cache-view="false"
不清除缓存,它禁用缓存。 从未实现具有cache-view="false"
视图缓存的方法,每次都加载控制器和视图。 阅读$ ionicHistory的文档如果要为某些特定视图禁用缓存视图,请在
<ion-view>
使用cache-view
属性。您还可以从这样的路由中禁用或启用缓存
.state('example', { url: '/example', cache: false, templateUrl: 'templates/example.html', controller: 'exampleCtrl' })
You have to run
$ionicHistory.clearCache();
in your controller when a user logout. Which will clear all view cache for a user.cache-view="false"
does not clear cache, it disables cache. Means withcache-view="false"
view cache was never implemented, controller and view were loaded every time. Read document of $ionicHistoryAnd if you want to disable cache view for some particular view then use
cache-view
attribute in<ion-view>
.You can also disable or enable cache from routes like this
.state('example', { url: '/example', cache: false, templateUrl: 'templates/example.html', controller: 'exampleCtrl' })
相关问答
更多-
如何使用bootstrap按钮连接window.location.reload()(How to connect window.location.reload() with bootstrap button)[2023-11-02]
HTML:您可以使用$location.path而不是$state.go : $location.path('/app/playlists'); 注意:不要忘记注入$ location。 You may use $location.path instead of $state.go: $location.path('/app/playlists'); Note: Don't forget to inject $location.$ window.location.reload(true)相当于CTRL + F5吗?(Is $window.location.reload(true) the equivalent of CTRL+F5?)[2021-12-11]
根据MDN , window.location.reload的forcedReload参数设置为true : ...导致页面始终从服务器重新加载。 如果为false或未指定,则浏览器可以从其缓存重新加载页面。 According to MDN the forcedReload parameter in window.location.reload, when set to true: ... causes the page to always be reloaded from the server. If ...ionic:加载div而不使用window.location.reload()(ionic : load a div without using window.location.reload())[2022-01-07]
你必须运行$ionicHistory.clearCache(); 在用户注销时在您的控制器中。 这将清除用户的所有视图缓存。 cache-view="false"不清除缓存,它禁用缓存。 从未实现具有cache-view="false"视图缓存的方法,每次都加载控制器和视图。 阅读$ ionicHistory的文档 如果要为某些特定视图禁用缓存视图,请在使用cache-view属性。 您还可以从这样的路由中禁用或启用缓存 .state('example', { url: '/ ... 如果您只需要删除一行文本,请不要重新加载页面。 根据您使用哪个窗口小部件显示名称列表,GWT中很可能只需要一行代码就可以删除它。 这是重新加载页面所需的代码,但它提供了更好的用户体验并消耗更少的资源。 Never reload a page if you only need to remove a single line of text. Depending on which widget is used to display the list of names in your case, it would ...避免使用第三方脚本的window.location.reload()(Avoid a third party script's window.location.reload())[2023-12-12]
关键是Oe.targetJSLoaded 。 找出Oe是什么。 尝试从Ne函数开始跟随调用堆栈。 例如,Harbor Freight的代码与您的代码类似: TNT.a.ge = function (he, ie, Tb, nc, Ub) { if (!ie.targetJSLoaded) { Ub.setCookie(Tb, true, nc); he.location.reload(); } }; 在您的函数和Harbor Freight的函数中,我们希望 ...答案是在$window.location.reload()上使用间谍 beforeEach(inject(function($controller, $window) { spyOn($window.location, 'reload'); authController = $controller('AuthController'); })); The answer was to use a spy on $window.location.reload() beforeEach(injec ...经过一些研究后回答自己: 它根本无法完成。 该问题与hash值无关,即使您不使用哈希也会出现问题。 似乎window.location.reload()不能用于控制当前资源(由window.location.href指示)是否要从缓存中使用。 虽然MDN上的文档另有说明。 window对象中的Location对象的官方W3C规范也没什么帮助。 Chrome和Firefox将始终执行到服务器的往返,无论您传递给.reload()参数是什么,都要求获取当前资源。 最初引入该参数是为了强制POST请求作为GET请 ...toggleLive是生成AJAX请求的函数吗? 您在点击之前立即呼叫重新加载,然后在后端反映更改。 如果您正在使用Jquery,请在完整的回调函数中包含重新加载代码,该函数表示您的AJAX请求已完成。 Is toggleLive the function that makes the AJAX request? You are calling reload immediately on click before changes are reflected on the backend. If you ar ...尝试做: window.location.reload(true); //dont load from cache Try doing: window.location.reload(true); //dont load from cache相关文章
更多- 单词f
- Python内建函数(F)
- windows下最好的豆瓣fm软件——K.F.storm豆瓣电台,没有之一
- INSERT INTO blog_appitem (user_id,appid,app_secret,is_valid) VALUES (1, 'wxf415741de036114c','48e1e345fd5f11c93af18ff1714c7f78',1)
- 用java把“真”这个字符转换为十六进制为“771f”,这是ascii还是unicode
- 问下 myeclipse中快捷键 Shift+Alt+J 和 Ctrl+F11 有什么区别 谢~
- solr python client
- solr 自定义 dismax查询方式
- Linux常用命令(整理)
- Bug分支-git入门教程
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)